mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
♻️ Run database setup explicitly before startup (#2426)
## AI Disclaimer Using Codex with gpt-5.6-sol. Reviewed manually.
This commit is contained in:
committed by
GitHub
parent
8893c6807a
commit
9d541082a3
+1
-16
@@ -53,10 +53,7 @@ services:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: true
|
||||
prestart:
|
||||
condition: service_completed_successfully
|
||||
# The YAML anchor lets the prestart service reuse this environment mapping.
|
||||
environment: &backend-environment
|
||||
environment:
|
||||
PROJECT_NAME: ${PROJECT_NAME:?Variable not set}
|
||||
BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS:-}
|
||||
SECRET_KEY: ${SECRET_KEY:?Variable not set}
|
||||
@@ -92,17 +89,5 @@ services:
|
||||
- traefik.http.routers.backend-http.rule=Host(`${DOMAIN:-localhost}`)
|
||||
- traefik.http.routers.backend-http.entrypoints=http
|
||||
|
||||
prestart:
|
||||
image: backend:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend/Dockerfile
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: true
|
||||
command: bash scripts/prestart.sh
|
||||
environment: *backend-environment
|
||||
|
||||
volumes:
|
||||
app-db-data:
|
||||
|
||||
Reference in New Issue
Block a user