made example deployments for different environments
Build and Push Docker Image / build-and-push (pull_request) Successful in 25s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s

This commit is contained in:
Brian Bjarke Jensen
2025-11-10 00:21:19 +01:00
parent 44c6f0168f
commit 3582ba13e8
2 changed files with 60 additions and 14 deletions
+60
View File
@@ -0,0 +1,60 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
# Persist database to local directory
- ./data:/data
environment:
# Set environment to production
- ENVIRONMENT=production
# Set admin credentials
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=password
# Use Redis for token storage
- REDIS_URI=redis://redis:6379/0
# Use PostgreSQL for database
- DATABASE_URL=postgresql://baby_monitor:securepassword@postgres:5432/b
command: ["--host", "0.0.0.0", "--port", "8000"]
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 1s
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_USER=baby_monitor
- POSTGRES_PASSWORD=securepassword
- POSTGRES_DB=baby_monitor_db
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U baby_monitor -d baby_monitor_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
redis-data:
pgdata:
-14
View File
@@ -16,19 +16,5 @@ services:
# Optional: Override admin credentials for development
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=password
# Optional: Use Redis for token storage (uncomment redis service below)
# - REDIS_URI=redis://redis:6379/0
command: ["--host", "0.0.0.0", "--port", "8000", "--reload"]
restart: unless-stopped
# Uncomment to enable Redis token storage
# redis:
# image: redis:7-alpine
# ports:
# - "6379:6379"
# volumes:
# - redis-data:/data
# restart: unless-stopped
# Uncomment if using Redis
# volumes:
# redis-data: