Skip to content

Commit

Permalink
improve Readme and add the possibility to use the postgres db with th…
Browse files Browse the repository at this point in the history
…e prod env
  • Loading branch information
kcinay055679 committed Aug 30, 2024
1 parent ea1e4d5 commit ff425f4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ USING DOCKER
- Run `docker-compose up`
- You have to restart after every code change `docker compose restart spring`
- Get the logs with `docker compose logs -f spring`
!IMPORTANT!
- If after the first start the backend is not reachable, restart the backend container with `docker compose restart spring`
- if any permission issues occur, following folders
- .angular
- frontend/dist
- frontend/node_modules
- backend/target

Formatting:
- Check code formatting: `mvn formatter:validate`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ values (21, 1,
13, 1, 31, 3, 'metric', null);

insert into quarter (id, label, start_date, end_date)
values (8, 'GJ 23/24-Q3', '2024-01-01', '2024-03-31');
values (8, 'GJ 23/24-Q3', '2024-01-01', '2024-03-31'),
(9, 'GJ 23/24-Q4', '2024-04-01', '2024-06-30'),
(10, 'GJ 24/25-Q1', '2024-07-01', '2024-09-30'),
(11, 'GJ 24/25-Q2', '2024-10-01', '2024-12-30');

delete
from team_organisation;
Expand Down
13 changes: 10 additions & 3 deletions docker/local-prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ services:
# SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER-URI: https://sso.puzzle.ch/auth/realms/pitc
# SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI: https://sso.puzzle.ch/auth/realms/pitc/protocol/openid-connect/certs
SPRING_SECURITY_OAUTH2_RESOURCESERVER_OPAQUETOKEN_CLIENT-ID: pitc_okr_staging
SPRING_DATASOURCE_URL: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
## Postgres DB
SPRING_DATASOURCE_URL: jdbc:postgresql://okr-dev-db:5432/okr
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: sa
SPRING_FLYWAY_LOCATIONS: classpath:db/h2-db/database-h2-schema,classpath:db/h2-db/data-test-h2
SPRING_DATASOURCE_PASSWORD: pwd
SPRING_FLYWAY_LOCATIONS: classpath:db/data-migration,classpath:db/migration

## In memory DB
# SPRING_DATASOURCE_URL: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
# SPRING_DATASOURCE_USERNAME: user
# SPRING_DATASOURCE_PASSWORD: sa
# SPRING_FLYWAY_LOCATIONS: classpath:db/h2-db/database-h2-schema,classpath:db/h2-db/data-test-h2
volumes:
- ../../../okr/backend/target:/app-root/backend
depends_on:
Expand Down

0 comments on commit ff425f4

Please sign in to comment.