-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.external-db.yml
More file actions
68 lines (65 loc) · 1.87 KB
/
docker-compose.external-db.yml
File metadata and controls
68 lines (65 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Milestone - Fresh Install with External/Managed PostgreSQL
#
# For corporate environments with a managed PostgreSQL server
# (AWS RDS, Azure Database, on-premise, etc.)
#
# Setup:
# 1. Copy .env.example to .env
# 2. Set DB_HOST, DB_PORT, PG_ADMIN_USER, PG_ADMIN_PASSWORD to your
# managed PostgreSQL server credentials
# 3. Run: docker compose -f docker-compose.external-db.yml up -d
#
# The app will:
# 1. Wait for PostgreSQL readiness at DB_HOST:DB_PORT
# 2. Auto-create application databases and schema (requires PG_ADMIN_* creds)
# 3. Seed default admin user
# 4. Start the application
#
# Required .env variables:
# DB_HOST=your-postgres-host.example.com
# DB_PORT=5432
# PG_ADMIN_USER=postgres # Needs CREATEDB/CREATEROLE privileges
# PG_ADMIN_PASSWORD=your-password
# SECRET_KEY=<generate with: python -c "import secrets; print(secrets.token_hex(32))">
# SESSION_SECRET=<generate with: python -c "import secrets; print(secrets.token_hex(32))">
#
# Access: http://localhost:8485/
services:
milestone:
build:
context: .
dockerfile: Dockerfile
container_name: milestone
restart: unless-stopped
ports:
- "8485:8485"
env_file:
- .env
environment:
- PORT=8485
- TZ=${TZ:-Europe/Zurich}
# Auto-initialization (creates DBs on first run)
- AUTO_INIT_DB=true
- INIT_ADMIN_EMAIL=${INIT_ADMIN_EMAIL:-admin@milestone.local}
- INIT_ADMIN_PASSWORD=${INIT_ADMIN_PASSWORD:-}
volumes:
- uploads:/app/uploads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8485/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
limits:
memory: 1g
reservations:
memory: 256m
networks:
- milestone-net
volumes:
uploads:
networks:
milestone-net:
driver: bridge