create docker compose setup

This commit is contained in:
Micha R. Albert 2025-07-03 15:03:12 -04:00
parent f2fd4c8d7c
commit 16e840fb78
Signed by: mra
SSH key fingerprint: SHA256:2JB0fGfy7m2HQXAzvSXXKm7wPTj9Z60MOjFOQGM2Y/E
9 changed files with 228 additions and 46 deletions

37
docker-compose.yml Normal file
View file

@ -0,0 +1,37 @@
services:
api:
build: .
ports:
- "8000:8000"
environment:
# Redis configuration
- REDIS_HOST=valkey
- REDIS_PORT=6379
# Docker environment flag
- DOCKER_CONTAINER=1
# Override environment for production
- ENVIRONMENT=production
env_file: .env
depends_on:
- valkey
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
valkey:
image: valkey/valkey:7-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
volumes:
- valkey_data:/data
volumes:
valkey_data: