setup setup
This commit is contained in:
@@ -15,6 +15,28 @@ services:
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
# Initialization service - runs setup tasks before backend starts
|
||||
init:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: api-init
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- REDIS_HOST=redis
|
||||
- RUN_INIT=true
|
||||
- INIT_MODE=${INIT_MODE:-infra} # Set via .env or override: INIT_MODE=infra,gais-data
|
||||
- INIT_ONLY=true # Exit after init, don't start server
|
||||
command: ["./docker-entrypoint.sh", "init-only"]
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- kevlarai-network
|
||||
profiles:
|
||||
- init # Only run when explicitly requested: docker compose --profile init up
|
||||
|
||||
backend:
|
||||
container_name: api
|
||||
build:
|
||||
@@ -24,6 +46,8 @@ services:
|
||||
- .env
|
||||
environment:
|
||||
- REDIS_HOST=redis
|
||||
- RUN_INIT=${RUN_INIT:-false} # Set to 'true' to run init on startup
|
||||
- INIT_MODE=${INIT_MODE:-infra} # Which init tasks to run
|
||||
ports:
|
||||
- 8000:8000
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user