Skip to content

Commit 6045927

Browse files
authored
Init and persistance (#230)
* Initializing and persisting volume * Newer key
1 parent 272dff9 commit 6045927

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ target
4848
klass.log*
4949
/.checkstyle
5050
.dccache
51+
52+
**/initdb/*.sql

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ This may be done by generating a Personal Access Token (classic) on GitHub with
8080
</servers>
8181
```
8282

83+
Colima should have at least 5G memory and the project folder must be mounted. Change this in `~/.colima/default/colima.yaml` e.g.
84+
```yaml
85+
memory: 5
86+
...
87+
mounts:
88+
- location: /Users/perolsen/Repository/github/klass
89+
writable: false
90+
```
91+
8392
### Introduction
8493
8594
It's recommended to build with maven before starting development as some classes are generated as part of the build process.

klass-forvaltning/src/main/resources/application.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ info.build.version=@project.version@
2222
#-----------------------
2323
#profiles for development (server configuration will override these)
2424
#-----------------------
25-
spring.profiles.active=frontend, h2-inmemory, small-import, skip-indexing, ad-offline, embedded-solr
25+
#spring.profiles.active=frontend, h2-inmemory, small-import, skip-indexing, ad-offline, embedded-solr
26+
spring.profiles.active=frontend, postgres-local, small-import, skip-indexing, ad-offline, embedded-solr
2627

2728
#Change port for when running multiple local applications
2829
server.port=8081

klass-shared/docker-compose.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ services:
1717
container_name: klass_postgres
1818
ports:
1919
- "5432:5432"
20+
volumes:
21+
- pgdata:/var/lib/postgresql/data
22+
- ./initdb:/docker-entrypoint-initdb.d
2023
environment:
2124
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
2225
POSTGRES_USER: "klass"
@@ -67,7 +70,6 @@ services:
6770
MARIADB_DATABASE: "klass"
6871
SPRING_PROFILES_ACTIVE: "mariadb-local"
6972
MARIADB_INSTANCE: ${MARIADB_INSTANCE}
70-
7173
klass-forvaltning:
7274
build:
7375
context: ../klass-forvaltning
@@ -76,8 +78,16 @@ services:
7678
profiles: [ frontend ]
7779
ports:
7880
- "8081:8081"
81+
depends_on:
82+
- postgresql
83+
command: [ "java", "-XshowSettings:vm", "-Xms512m", "-Xmx2g", "-jar", "app.war", "--spring.profiles.active=frontend, postgres-local, ad-offline, small-import, skip-indexing, embedded-solr" ]
84+
deploy:
85+
resources:
86+
limits:
87+
memory: 3G
7988
environment:
80-
SPRING_PROFILES_ACTIVE: frontend, postgres-local, ad-offline, skip-indexing, embedded-solr
8189
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
8290
POSTGRES_USER: "klass"
8391
POSTGRES_INSTANCE: ${POSTGRES_INSTANCE}
92+
volumes:
93+
pgdata:

klass-shared/initdb/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)