Skip to content

Commit

Permalink
Bug #3: Refactor environment variables
Browse files Browse the repository at this point in the history
- Remove overwritten defaults of application-dev.yml
- Use upper case environment properties in docker-compose.yml; update README.md where required
- Add restart always in docker-compose.yml
- Make explicit secret in backend and proxy are the same
  • Loading branch information
fjlopez committed Jul 3, 2024
1 parent 5790d6e commit ba40aba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The SITMUN Application Stack uses Docker Compose to define the services, specifi

### Configuration Notes

For testing purposes, the use of the `proxy` is controlled by the `sitmun.proxy.force` environment variable in `backend`, which by default is `true`.
For testing purposes, the use of the `proxy` is controlled by the `SITMUN_PROXY_FORCE` environment variable in `backend`, which by default is `true`.

Data is stored in the `pgdata` volume, which is used by the `postgres` service.

Expand Down
6 changes: 0 additions & 6 deletions back/backend/config/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ spring:
indent-output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: ${JDBC_DATABASE_URL}
username: ${JDBC_DATABASE_USERNAME}
password: ${JDBC_DATABASE_PASSWORD}
hikari:
poolName: Hikari
auto-commit: false
Expand All @@ -60,8 +57,6 @@ security:
jwt:
secret: 9ef80c644166846897f6a87d3cf6ab204d144229
token-validity-in-miliseconds: 36000000
middleware:
secret: 9ef80c644166846897f6a87d3cf6ab204d144229
ldap:
host: ldap://localhost:1389
base_dn: dc=example,dc=com
Expand All @@ -83,4 +78,3 @@ sitmun:
cartographies-by-created-date.size: 30 #last days
users-by-created-date.size: 30 # last days
users-per-application.size: 30 # last days

15 changes: 8 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
front:
build:
context: ./front
build: ./front
restart: always
ports:
- "9000:80"
environment:
Expand All @@ -14,6 +14,7 @@ services:

backend:
build: ./back/backend
restart: always
ports:
- "9001:8080"
depends_on:
Expand All @@ -22,15 +23,15 @@ services:
- SPRING_DATASOURCE_URL=jdbc:postgresql://persistence:5432/sitmun3
- SPRING_DATASOURCE_USERNAME=sitmun3
- SPRING_DATASOURCE_PASSWORD=sitmun3
- spring.datasource.driver-class-name=org.postgresql.Driver
- sitmun.proxy.force=true
- sitmun.proxy.url=http://localhost:9000/middleware
- SITMUN_PROXY_FORCE=true
- SITMUN_PROXY_URL=http://localhost:9000/middleware
- SECURITY_AUTHENTICATION_MIDDLEWARE_SECRET=9ef80c644166846897f6a87d3cf6ab204d144229
volumes:
- ./back/backend/config:/usr/src/config

proxy:
build:
context: ./back/proxy
build: ./back/proxy
restart: always
ports:
- "9002:8080"
depends_on:
Expand Down

0 comments on commit ba40aba

Please sign in to comment.