Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (86 loc) · 2.61 KB
/
Copy pathdocker-compose.yml
File metadata and controls
90 lines (86 loc) · 2.61 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
services:
db:
build:
context: ./postgres
user: postgres
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
environment:
POSTGRES_DB: pystarter
POSTGRES_USER: pystarter_admin
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD:?Run init.sh or init.ps1 first}
APP_DB_PASSWORD: ${DB_PASSWORD:?Run init.sh or init.ps1 first}
volumes:
- pgdata:/var/lib/postgresql/data
- ./scripts/init-db.sh:/docker-entrypoint-initdb.d/10-pystarter.sh:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pystarter_admin -d pystarter"]
interval: 5s
timeout: 5s
retries: 5
backend:
build:
context: .
dockerfile: backend/Dockerfile
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
pids_limit: 128
mem_limit: 1g
environment:
DJANGO_SETTINGS_MODULE: config.settings.production
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?Run init.sh or init.ps1 first}
ALLOWED_HOSTS: localhost,127.0.0.1
CORS_ALLOWED_ORIGINS: http://localhost:${NGINX_PORT:-8080}
DB_HOST: db
DB_NAME: pystarter
DB_USER: pystarter
DB_PASSWORD: ${DB_PASSWORD:?Run init.sh or init.ps1 first}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
ANTHROPIC_MODEL: ${ANTHROPIC_MODEL:-}
ANTHROPIC_BASE_URL: ${ANTHROPIC_BASE_URL:-}
EMAIL_HOST: ${EMAIL_HOST:-}
EMAIL_PORT: ${EMAIL_PORT:-587}
EMAIL_HOST_USER: ${EMAIL_HOST_USER:-}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD:-}
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-noreply@localhost}
# Local HTTP only. This Compose file intentionally cannot bind publicly.
SECURE_SSL_REDIRECT: "False"
SESSION_COOKIE_SECURE: "False"
CSRF_COOKIE_SECURE: "False"
SECURE_HSTS_SECONDS: "0"
depends_on:
db:
condition: service_healthy
expose: ["8000"]
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health/')"]
interval: 10s
timeout: 5s
retries: 6
start_period: 40s
frontend:
build:
context: frontend
dockerfile: Dockerfile
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
read_only: true
tmpfs: [/tmp]
expose: ["8080"]
nginx:
build:
context: nginx
dockerfile: Dockerfile
security_opt: [no-new-privileges:true]
cap_drop: [ALL]
read_only: true
tmpfs: [/tmp]
ports:
- "127.0.0.1:${NGINX_PORT:-8080}:8080"
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_started
volumes:
pgdata: