diff --git a/docker/compose.dev.yaml b/docker/compose.dev.yaml index 305c40e6..ea225b52 100644 --- a/docker/compose.dev.yaml +++ b/docker/compose.dev.yaml @@ -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: diff --git a/docker/compose.staging.yaml b/docker/compose.staging.yaml index 96377e5e..23e10a10 100644 --- a/docker/compose.staging.yaml +++ b/docker/compose.staging.yaml @@ -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 @@ -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: diff --git a/docker/compose.yaml b/docker/compose.yaml index 2b8b0a2a..20ca47a6 100644 --- a/docker/compose.yaml +++ b/docker/compose.yaml @@ -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: @@ -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