Skip to content

Commit

Permalink
Merge pull request #198 from ricardogsilva/195-update-observations-da…
Browse files Browse the repository at this point in the history
…ta-periodically-config-fix

Add missing docker compose config for prefect services on staging
  • Loading branch information
ricardogsilva authored Aug 21, 2024
2 parents 3be86be + e540c7d commit 861c54c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
8 changes: 0 additions & 8 deletions docker/compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,8 @@ services:

prefect-static-worker:
image: *webapp-image
command: [
"start-periodic-tasks",
"--refresh-stations",
"--refresh-monthly-measurements",
"--refresh-seasonal-measurements",
"--refresh-yearly-measurements",
]
environment:
PREFECT_API_URL: "http://prefect-server:4200/api"
ARPAV_PPCV__PREFECT__OBSERVATION_STATIONS_REFRESHER_FLOW_CRON_SCHEDULE: "*/5 * * * *"
PREFECT_DEBUG_MODE: true
<<: *common-env
volumes:
Expand Down
29 changes: 29 additions & 0 deletions docker/compose.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ x-env-file-db: &env-file-db ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_DB_SERVICE:-/home/a
x-env-file-webapp: &env-file-webapp ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_WEBAPP_SERVICE:-/home/arpav/environment-files/webapp-service.env}
x-env-file-martin: &env-file-martin ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_MARTIN_SERVICE:-/home/arpav/environment-files/martin-service.env}
x-env-file-frontend: &env-file-frontend ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_FRONTEND_SERVICE:-/home/arpav/environment-files/frontend-service.env}
x-env-file-prefect-db: &env-file-prefect-db ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_PREFECT_DB_SERVICE:-/home/arpav/environment-files/prefect-db-service.env}
x-env-file-prefect-server: &env-file-prefect-server ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_PREFECT_SERVER_SERVICE:-/home/arpav/environment-files/prefect-server-service.env}
x-env-file-prefect-static-worker: &env-file-prefect-static-worker ${ARPAV_PPCV_DEPLOYMENT_ENV_FILE_PREFECT_STATIC_WORKER_SERVICE:-/home/arpav/environment-files/prefect-static-worker-service.env}

name: arpav-ppcv-staging

Expand Down Expand Up @@ -126,5 +129,31 @@ services:
target: /additional
restart: unless-stopped

prefect-server:
networks:
- back
labels:
- "traefik.http.routers.prefect-router.entrypoints=web"
- "exposed.inside=true"
env_file:
- *env-file-prefect-server

prefect-static-worker:
networks:
- back
env_file:
- *env-file-prefect-static-worker
restart: unless-stopped

prefect-db:
networks:
- back
env_file:
- *env-file-prefect-db
volumes:
- prefect-db-data:/var/lib/postgresql/data
restart: unless-stopped

volumes:
db-data:
prefect-db-data:
9 changes: 8 additions & 1 deletion docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ services:
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}
source: ${ARPAV_PPCV_TRAEFIK_BASIC_AUTH_USERS_FILE:-$PWD/docker/traefik/basicauth-users.txt}
target: /traefikauth/usersfile

frontend:
Expand Down Expand Up @@ -121,6 +121,13 @@ services:
prefect-static-worker:
image: *backend-image
entrypoint: ["tini", "-g", "--", "poetry", "run", "arpav-ppcv", "prefect"]
command: [
"start-periodic-tasks",
"--refresh-stations",
"--refresh-monthly-measurements",
"--refresh-seasonal-measurements",
"--refresh-yearly-measurements",
]
depends_on:
prefect-server:
condition: service_healthy
Expand Down

0 comments on commit 861c54c

Please sign in to comment.