lila/docker-compose.yml

108 lines
2.6 KiB
YAML

services:
database:
container_name: lila-database
image: postgres:18.3-alpine3.23
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data
ports:
- "5432:5432"
volumes:
- lila-db:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
pipeline-database:
container_name: lila-pipeline-database
image: postgres:18.3-alpine3.23
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data
- POSTGRES_USER=${PIPELINE_POSTGRES_USER}
- POSTGRES_PASSWORD=${PIPELINE_POSTGRES_PASSWORD}
- POSTGRES_DB=${PIPELINE_POSTGRES_DB}
ports:
- "5433:5432"
volumes:
- pipeline-db:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${PIPELINE_POSTGRES_USER} -d ${PIPELINE_POSTGRES_DB}",
]
interval: 5s
timeout: 5s
retries: 5
valkey:
container_name: lila-valkey
image: valkey/valkey:9.1-alpine3.23
ports:
- "6379:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
api:
container_name: lila-api
user: "${UID}:${GID}"
build:
context: .
dockerfile: ./apps/api/Dockerfile
target: dev
env_file:
- .env
ports:
- "3000:3000"
volumes:
- ./apps/api:/app/apps/api # Hot reload API code
- ./packages/shared:/app/packages/shared # Hot reload shared
- ./packages/db:/app/packages/db
- /app/node_modules
restart: unless-stopped
healthcheck:
test:
["CMD-SHELL", "wget -qO- http://localhost:3000/api/v1/health || exit 1"]
interval: 5s
timeout: 3s
retries: 5
depends_on:
database:
condition: service_healthy
valkey:
condition: service_healthy
web:
container_name: lila-web
user: "${UID}:${GID}"
build:
context: .
dockerfile: ./apps/web/Dockerfile
target: dev
ports:
- "5173:5173"
volumes:
- ./apps/web:/app/apps/web # Hot reload: local edits reflect immediately
- ./packages/shared:/app/packages/shared
- /app/node_modules # Protect container's node_modules from being overwritten
environment:
- VITE_API_URL=http://localhost:3000
restart: unless-stopped
depends_on:
api:
condition: service_healthy
volumes:
lila-db:
pipeline-db: