-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
112 lines (107 loc) · 3.14 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
112 lines (107 loc) · 3.14 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
101
102
103
104
105
106
107
108
109
110
111
112
networks:
prod_network:
name: prod_network
driver: bridge
secrets:
oauth_client_secret:
file: ./oauth_client_secret.secret
postgres_password:
file: ./postgres_password.secret
services:
# Production backend
backend:
user: root
privileged: true
build:
context: ./backend
dockerfile: Dockerfile
target: production # Use production target
ports:
- "${BACKEND_PORT:-8080}:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Production
- CONNECTION_STRING=Host=/run/postgresql/;Port=5432;Username=committeeclash;Password=<PASSWORD>;Database=committeeclash
- OAUTH_PROVIDER_NAME=${OAUTH_PROVIDER_NAME:-Koala}
- OAUTH_PROVIDER_URL=${OAUTH_PROVIDER_URL:-https://koala.svsticky.nl/}
- OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
- ADMIN_CLAIM=${ADMIN_CLAIM:-is_admin}
secrets:
- oauth_client_secret
- postgres_password
extra_hosts:
- "koala.dev.svsticky.nl:49.13.151.68"
networks:
- prod_network
volumes:
- submittedimages:/app/submittedimages # Persist submitted images
- /run/postgresql/.s.PGSQL.5432:/run/postgresql/.s.PGSQL.5432
healthcheck:
test: ["CMD", "curl", "-f", "http://backend:8080/status"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
restart: unless-stopped
logging:
driver: "local"
options:
max-size: "10m"
max-file: "5"
# Production frontend
frontend:
user: root
privileged: true
build:
context: ./frontend
dockerfile: Dockerfile
target: production # Use production target
args:
NEXT_PUBLIC_OAUTH_PROVIDER_NAME: ${OAUTH_PROVIDER_NAME:-Koala}
NEXT_PUBLIC_OAUTH_PROVIDER_URL: ${OAUTH_PROVIDER_URL:-https://koala.svsticky.nl/}
NEXT_PUBLIC_THEME_COLOR: ${THEME_COLOR:-#FA6B20}
NEXT_PUBLIC_HOST_URL: ${HOST_URL:-http://localhost:3000}
ports:
- "${PORT:-3000}:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_OAUTH_PROVIDER_NAME=${OAUTH_PROVIDER_NAME:-Koala}
- NEXT_PUBLIC_OAUTH_PROVIDER_URL=${OAUTH_PROVIDER_URL:-https://koala.svsticky.nl/}
- OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
- NEXT_PUBLIC_THEME_COLOR=${THEME_COLOR:-#FA6B20}
- NEXTAUTH_URL=${HOST_URL:-http://localhost:3000}
- NEXT_PUBLIC_HOST_URL=${HOST_URL:-http://localhost:3000}
secrets:
- oauth_client_secret
extra_hosts:
- "koala.dev.svsticky.nl:49.13.151.68"
depends_on:
backend:
condition: service_healthy
networks:
- prod_network
restart: unless-stopped
logging:
driver: "local"
options:
max-size: "10m"
max-file: "5"
docs:
build:
context: .
dockerfile: docs/Dockerfile
target: production # Use production target
ports:
- "${DOCS_PORT:-3001}:3001"
environment:
- NODE_ENV=production
networks:
- prod_network
restart: unless-stopped
logging:
driver: "local"
options:
max-size: "10m"
max-file: "5"
volumes:
postgres_data: # Persistent volume for database
submittedimages: # Persistent volume for submitted images