Repository navigation
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
100 lines (96 loc) 路 2.93 KB
/
Copy pathdocker-compose.local.yml
File metadata and controls
100 lines (96 loc) 路 2.93 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
91
92
93
94
95
96
97
98
99
100
services:
db:
image: postgres:18-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ${POSTGRES_DB:-sourcerer}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql
# Mount the schema file to initialize the DB automatically
- ./backend/schema.sql:/docker-entrypoint-initdb.d/init.sql:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
backend:
build:
context: .
dockerfile: backend/Dockerfile
ports:
- "8080:8080"
environment:
- ENV=development
- DATABASE_URL=host=db user=${POSTGRES_USER:-postgres} password=${POSTGRES_PASSWORD} dbname=${POSTGRES_DB:-sourcerer} sslmode=disable
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:?GITHUB_CLIENT_ID must be set}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:?GITHUB_CLIENT_SECRET must be set}
- SESSION_SECRET=${SESSION_SECRET:?SESSION_SECRET must be set}
- API_INTERNAL_TOKEN=${API_INTERNAL_TOKEN:?API_INTERNAL_TOKEN must be set}
- PUBLIC_BASE_URL=${PUBLIC_BASE_URL:-http://localhost:8080}
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-}
volumes:
# Enables template and stylesheet hot-reload in development
- ./backend/templates:/app/templates:ro
- ./backend/static:/app/static:ro
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:8080/healthz"]
interval: 15s
timeout: 5s
retries: 3
start_period: 20s
depends_on:
db:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
proxy:
image: nginx:1.27-alpine
ports:
- "80:80"
- "443:443"
environment:
- SERVER_NAME=${SERVER_NAME:-_}
- SSL_CERTIFICATE=${SSL_CERTIFICATE:-/etc/nginx/ssl/fullchain.pem}
- SSL_CERTIFICATE_KEY=${SSL_CERTIFICATE_KEY:-/etc/nginx/ssl/privkey.pem}
volumes:
- ./nginx/templates:/etc/nginx/templates:ro
- ./nginx/entrypoint.d/99-cert-reload.sh:/docker-entrypoint.d/99-cert-reload.sh:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 5s
retries: 3
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
dozzle:
image: amir20/dozzle:latest
ports:
- "9999:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 1g
volumes:
postgres_data:
gradle_cache: