- Fix healthchecks to use internal ports (8080, 8081, 8082, 7700) instead of external ports - Remove variable expansion from healthcheck URLs (not supported in compose) - Update .env.example to clarify internal vs external ports - Ensure DATABASE_URL always uses internal PostgreSQL port (5432) - Services now correctly start with custom external port mappings
119 lines
2.8 KiB
YAML
119 lines
2.8 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: stripstream
|
|
POSTGRES_USER: stripstream
|
|
POSTGRES_PASSWORD: stripstream
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U stripstream -d stripstream"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
meilisearch:
|
|
image: getmeili/meilisearch:v1.12
|
|
env_file:
|
|
- ../.env
|
|
ports:
|
|
- "${MEILI_PORT:-7700}:7700"
|
|
volumes:
|
|
- meili_data:/meili_data
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7700/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
migrate:
|
|
image: postgres:16-alpine
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
POSTGRES_USER: stripstream
|
|
POSTGRES_PASSWORD: stripstream
|
|
POSTGRES_DB: stripstream
|
|
volumes:
|
|
- ./migrations:/migrations:ro
|
|
command:
|
|
[
|
|
"sh",
|
|
"-c",
|
|
"export PGPASSWORD=$$POSTGRES_PASSWORD; for f in /migrations/*.sql; do echo \"Applying migration: $$f\"; psql -h postgres -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\" -f \"$$f\" || exit 1; done",
|
|
]
|
|
|
|
api:
|
|
build:
|
|
context: ..
|
|
dockerfile: apps/api/Dockerfile
|
|
env_file:
|
|
- ../.env
|
|
ports:
|
|
- "${API_PORT:-8080}:8080"
|
|
volumes:
|
|
- ${LIBRARIES_HOST_PATH:-../libraries}:/libraries
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
postgres:
|
|
condition: service_healthy
|
|
meilisearch:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8080/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
indexer:
|
|
build:
|
|
context: ..
|
|
dockerfile: apps/indexer/Dockerfile
|
|
env_file:
|
|
- ../.env
|
|
ports:
|
|
- "${INDEXER_PORT:-8081}:8081"
|
|
volumes:
|
|
- ${LIBRARIES_HOST_PATH:-../libraries}:/libraries
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
postgres:
|
|
condition: service_healthy
|
|
meilisearch:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8081/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backoffice:
|
|
build:
|
|
context: ..
|
|
dockerfile: apps/backoffice/Dockerfile
|
|
env_file:
|
|
- ../.env
|
|
environment:
|
|
- PORT=8082
|
|
- HOST=0.0.0.0
|
|
ports:
|
|
- "${BACKOFFICE_PORT:-8082}:8082"
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:8082/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
postgres_data:
|
|
meili_data:
|