-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
169 lines (162 loc) · 4.5 KB
/
Copy pathcompose.yaml
File metadata and controls
169 lines (162 loc) · 4.5 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
services:
redis:
image: redis:8
container_name: redis
restart: always
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
db:
image: postgres:16
container_name: postgres
restart: always
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: answerflow
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
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://admin:mypassword@db:5432/answerflow
command: pnpm --filter @answerflow/db run migrate:deploy
mailpit:
image: axllent/mailpit
container_name: mailpit
restart: unless-stopped
volumes:
- mailpit_data:/data
ports:
- 8025:8025
- 1025:1025
environment:
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
adminer:
image: adminer
container_name: adminer
ports:
- 8080:8080
depends_on:
db:
condition: service_healthy
restart: always
environment:
ADMINER_DEFAULT_SERVER: db
minio:
image: minio/minio:latest
container_name: minio
ports:
- "9000:9000" # S3 API
- "9001:9001" # Web console
environment:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: mypassword
MINIO_API_CORS_ALLOW_ORIGIN: "*"
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 10
minio-init:
image: minio/mc
container_name: minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 admin mypassword &&
mc mb -p local/answerflow || true &&
mc anonymous set public local/answerflow
"
web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
- NEXT_PUBLIC_CDN_URL=${NEXT_PUBLIC_CDN_URL:-http://localhost:9000/answerflow}
- NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY:-demo_key}
- NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN:-demo_domain}
- NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID:-demo_project}
- NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET:-demo_bucket}
- NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID:-demo_sender}
- NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID:-demo_app}
- NEXT_PUBLIC_FIREBASE_VAPID_KEY=${NEXT_PUBLIC_FIREBASE_VAPID_KEY:-demo_vapid}
container_name: web
restart: always
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
minio:
condition: service_healthy
worker:
condition: service_started
mailpit:
condition: service_started
migrator:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql://admin:mypassword@db:5432/answerflow
REDIS_URL: redis://redis:6379
AUTH_URL: http://localhost:3000
AUTH_SECRET: any_strong_secret_key_here
S3_BUCKET_NAME: answerflow
S3_ENDPOINT: http://minio:9000
S3_REGION: us-east-1
S3_ACCESS_KEY_ID: admin
S3_SECRET_ACCESS_KEY: mypassword
S3_PATH_STYLE: "true"
ports:
- "3000:3000"
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
container_name: background-worker
restart: always
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
mailpit:
condition: service_started
migrator:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql://admin:mypassword@db:5432/answerflow
REDIS_URL: redis://redis:6379
SMTP_URL: smtp://mailpit:1025
EMAIL_FROM_ADDRESS: noreply@answerflow.dev
volumes:
db_data:
mailpit_data:
minio_data: