@@ -42,6 +42,41 @@ services:
4242 - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls.certresolver=le
4343 - traefik.http.services.${STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080
4444
45+ prestart :
46+ image : ' ${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
47+ build :
48+ context : ./backend
49+ args :
50+ INSTALL_DEV : ${INSTALL_DEV-false}
51+ networks :
52+ - traefik-public
53+ - default
54+ depends_on :
55+ db :
56+ condition : service_healthy
57+ restart : true
58+ command : bash prestart.sh
59+ env_file :
60+ - .env
61+ environment :
62+ - DOMAIN=${DOMAIN}
63+ - FRONTEND_HOST=${FRONTEND_HOST?Variable not set}
64+ - ENVIRONMENT=${ENVIRONMENT}
65+ - BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
66+ - SECRET_KEY=${SECRET_KEY?Variable not set}
67+ - FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
68+ - FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
69+ - SMTP_HOST=${SMTP_HOST}
70+ - SMTP_USER=${SMTP_USER}
71+ - SMTP_PASSWORD=${SMTP_PASSWORD}
72+ - EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
73+ - POSTGRES_SERVER=db
74+ - POSTGRES_PORT=${POSTGRES_PORT}
75+ - POSTGRES_DB=${POSTGRES_DB}
76+ - POSTGRES_USER=${POSTGRES_USER?Variable not set}
77+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
78+ - SENTRY_DSN=${SENTRY_DSN}
79+
4580 backend :
4681 image : ' ${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
4782 restart : always
@@ -52,6 +87,8 @@ services:
5287 db :
5388 condition : service_healthy
5489 restart : true
90+ prestart :
91+ condition : service_completed_successfully
5592 env_file :
5693 - .env
5794 environment :
@@ -74,7 +111,7 @@ services:
74111 - SENTRY_DSN=${SENTRY_DSN}
75112
76113 healthcheck :
77- test : ["CMD", "curl", "-f", "http://localhost/api/v1/utils/health-check/"]
114+ test : ["CMD", "curl", "-f", "http://localhost:8000 /api/v1/utils/health-check/"]
78115 interval : 10s
79116 timeout : 5s
80117 retries : 5
@@ -88,7 +125,7 @@ services:
88125 - traefik.docker.network=traefik-public
89126 - traefik.constraint-label=traefik-public
90127
91- - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=80
128+ - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=8000
92129
93130 - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=Host(`api.${DOMAIN?Variable not set}`)
94131 - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.entrypoints=http
0 commit comments