create docker compose setup
This commit is contained in:
parent
f2fd4c8d7c
commit
16e840fb78
9 changed files with 228 additions and 46 deletions
37
docker-compose.yml
Normal file
37
docker-compose.yml
Normal 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:
|
||||
Loading…
Add table
Add a link
Reference in a new issue