-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.prod.yaml
More file actions
106 lines (101 loc) · 3.06 KB
/
Copy pathcompose.prod.yaml
File metadata and controls
106 lines (101 loc) · 3.06 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
services:
redis:
image: redis:8
container_name: redis
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
db:
image: postgres:16
container_name: postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-admin}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-answerflow_secure_pass}
POSTGRES_DB: ${POSTGRES_DB:-answerflow}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-admin}"]
interval: 5s
timeout: 5s
retries: 10
migrator:
build:
context: .
dockerfile: apps/web/Dockerfile
target: builder
container_name: prisma-migrator
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-answerflow_secure_pass}@db:5432/${POSTGRES_DB:-answerflow}
command: pnpm --filter @answerflow/db run migrate:deploy
web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
- NEXT_PUBLIC_CDN_URL=${NEXT_PUBLIC_CDN_URL}
- NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
- NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}
- NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID}
- NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET}
- NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}
- NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID}
- NEXT_PUBLIC_FIREBASE_VAPID_KEY=${NEXT_PUBLIC_FIREBASE_VAPID_KEY}
container_name: web
restart: always
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
worker:
condition: service_started
migrator:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-answerflow_secure_pass}@db:5432/${POSTGRES_DB:-answerflow}
REDIS_URL: redis://redis:6379
NEXT_PUBLIC_APP_URL: https://${DOMAIN_NAME}
env_file:
- apps/web/.env
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
container_name: background-worker
restart: always
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
migrator:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-admin}:${POSTGRES_PASSWORD:-answerflow_secure_pass}@db:5432/${POSTGRES_DB:-answerflow}
REDIS_URL: redis://redis:6379
env_file:
- apps/worker/.env
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- web
volumes:
db_data:
caddy_data:
caddy_config: