Skip to content

Commit

Permalink
Modify docker compose files to use secrets and configs (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogsilva authored Oct 1, 2024
1 parent 1082688 commit 70b3c6c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
18 changes: 9 additions & 9 deletions docker/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ services:
published: 8899
- target: 8080
published: 8878
command: --configFile /traefik.toml
volumes:
- type: bind
source: $PWD/docker/traefik/dev-config.toml
configs:
- source: traefik-conf
target: /traefik.toml
command: --configFile /traefik.toml

frontend:
image: "ghcr.io/geobeyond/arpav-ppcv/arpav-ppcv:${FRONTEND_GIT_BRANCH:-latest}"
Expand Down Expand Up @@ -161,14 +160,9 @@ services:
ports:
- target: 3000
published: 3000
command: ["--config", "/martin-config.yaml"]
environment:
DATABASE_URL: postgres://arpav:arpavpassword@db/arpav_ppcv
RUST_LOG: actix_web=info,martin=debug,tokio_postgres=debug
volumes:
- type: bind
source: /$PWD/docker/martin/config.yaml
target: /martin-config.yaml

prefect-server:
labels:
Expand Down Expand Up @@ -262,3 +256,9 @@ volumes:
prefect-db-data:
tolgee-app-data:
tolgee-db-data:


configs:

traefik-conf:
file: $PWD/docker/traefik/dev-config.toml
17 changes: 8 additions & 9 deletions docker/compose.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
# is another proxy running on top of this one, provided
# by the staging env
reverse-proxy:
command: --configFile /opt/traefik/traefik.toml
command: --configFile /traefik.toml
labels:
- "traefik.enable=true"
- "traefik.http.routers.outside-router-arpav-backend.entrypoints=webSecure"
Expand All @@ -49,10 +49,9 @@ services:
networks:
- front
- back
volumes:
- type: bind
source: /home/arpav/docker/traefik/staging-config.toml
target: /opt/traefik/traefik.toml
configs:
- source: traefik-conf
target: /traefik.toml

frontend:
env_file:
Expand Down Expand Up @@ -101,10 +100,6 @@ services:
- "traefik.http.routers.martin-router.entrypoints=web"
- "traefik.http.routers.martin-router.rule=Host(`arpav.geobeyond.dev`) && PathPrefix(`/vector-tiles`)"
- "exposed.inside=true"
volumes:
- type: bind
source: /home/arpav/docker/martin/config.yaml
target: /martin-config.yaml
restart: unless-stopped

thredds:
Expand Down Expand Up @@ -188,3 +183,7 @@ volumes:
db-data:
prefect-db-data:
tolgee-db-data:

configs:
traefik-conf:
file: /home/arpav/docker/traefik/staging-config.toml
22 changes: 18 additions & 4 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ services:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
- type: bind
source: ${ARPAV_PPCV_TRAEFIK_BASIC_AUTH_USERS_FILE:-$PWD/docker/traefik/basicauth-users.txt}
target: /traefikauth/usersfile
secrets:
- traefik-users-file

frontend:
image: "ghcr.io/geobeyond/arpav-ppcv/arpav-ppcv:latest"
Expand All @@ -92,6 +91,9 @@ services:

martin:
image: 'ghcr.io/maplibre/martin:v0.13.0'
command: ["--config", "/martin-conf"]
configs:
- martin-conf
labels:
- "traefik.enable=true"
- "traefik.http.routers.martin-router.rule=PathPrefix(`/vector-tiles`)"
Expand All @@ -112,7 +114,7 @@ services:
- "traefik.http.middlewares.middleware-chain.chain.middlewares=prefect-auth,replace-prefect-path-middleware"
- "traefik.http.middlewares.replace-prefect-path-middleware.replacepathregex.regex=/prefect/api"
- "traefik.http.middlewares.replace-prefect-path-middleware.replacepathregex.replacement=/api"
- "traefik.http.middlewares.prefect-auth.basicauth.usersfile=/traefikauth/usersfile"
- "traefik.http.middlewares.prefect-auth.basicauth.usersfile=/run/secrets/traefik-users-file"
- "traefik.http.routers.prefect-router.middlewares=middleware-chain"
depends_on:
prefect-db:
Expand Down Expand Up @@ -154,3 +156,15 @@ services:
environment:
PG_DATA: /var/lib/postgresql/data/pgdata
healthcheck: *postgres-db-healthcheck


configs:

martin-conf:
file: $PWD/docker/martin/config.yaml


secrets:

traefik-users-file:
file: ${ARPAV_PPCV_TRAEFIK_BASIC_AUTH_USERS_FILE:-$PWD/docker/traefik/basicauth-users.txt}

0 comments on commit 70b3c6c

Please sign in to comment.