-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
170 lines (154 loc) · 4.16 KB
/
docker-compose.yml
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
170
version: "3.5"
services:
reverse-proxy:
image: traefik:v3.0
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.websecure.address=:443"
- "--tls.certificates.certFile=${CERT_FILE_PATH}"
- "--tls.certificates.keyFile=${KEY_FILE_PATH}"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${LETSENCRYPT_DATA}:/letsencrypt
postgres:
image: postgres:16-alpine
container_name: jimmodel_postgres
restart: always
ports:
- "5432:5432"
volumes:
- ${POSTGRES_DATA}:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
labels:
- "traefik.enable=false"
minio:
image: quay.io/minio/minio
container_name: jimmodel_minio
restart: always
volumes:
- ${MINIO_DATA}:/data
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"
healthcheck:
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
interval: 5s
retries: 1
start_period: 5s
timeout: 5s
labels:
- "traefik.enable=false"
redis:
image: "redis:7-alpine"
container_name: jimmodel_redis
restart: always
ports:
- "6379:6379"
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
volumes:
- ${REDIS_DATA}:/data
labels:
- "traefik.enable=false"
app:
build:
context: .
args:
- NODE_ENV=production
target: runner
network: host
extra_hosts:
- redis:127.0.0.1
- postgres:127.0.0.1
- minio:127.0.0.1
container_name: jimmodel_app
restart: always
depends_on:
postgres:
condition: service_healthy
environment:
URL: ${URL}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_HOST: postgres
AUTH_SECRET: ${AUTH_SECRET}
AUTH_TRUST_HOST: true
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_ENDPOINT: minio
S3_PORT: 9000
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
labels:
- "traefik.enable=true"
- traefik.http.routers.app.rule=Host(`${DOMAIN}`)
- "traefik.http.routers.app.entrypoints=websecure"
- "traefik.http.services.app.loadbalancer.server.port=3000"
- "traefik.http.routers.app.tls=true"
minio-mc:
image: minio/mc
container_name: minio_bootstrap_runner
depends_on:
minio:
condition: service_healthy
volumes:
- ./scripts/minio-entrypoint.sh:/scripts/entrypoint.sh
entrypoint: /scripts/entrypoint.sh
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
ACCESS_KEY: ${S3_ACCESS_KEY}
SECRET_KEY: ${S3_SECRET_KEY}
BUCKET_NAME: ${S3_BUCKET_NAME}
MINIO_URL: http://minio:9000
labels:
- "traefik.enable=false"
bootstrap_runner:
build:
context: .
args:
- NODE_ENV=production
target: bootstrap_runner
container_name: jimmodel_bootstrap_runner
depends_on:
postgres:
condition: service_healthy
environment:
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_HOST: postgres
ROOT_EMAIL: ${ROOT_EMAIL}
ROOT_NAME: ${ROOT_NAME}
ROOT_PASSWORD: ${ROOT_PASSWORD}
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_ENDPOINT: minio
S3_PORT: 9000
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
labels:
- "traefik.enable=false"