-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
158 lines (150 loc) · 4.48 KB
/
docker-compose.yml
File metadata and controls
158 lines (150 loc) · 4.48 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
name: cloud-fullstack-docker
services:
postgres:
image: postgres:16-alpine
container_name: cloud-fullstack-docker-postgres
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 8
redis:
image: redis:7-alpine
container_name: cloud-fullstack-docker-redis
ports:
- "${REDIS_PORT}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 8
minio:
image: minio/minio:latest
container_name: cloud-fullstack-docker-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
ports:
- "${MINIO_API_PORT}:9000"
- "${MINIO_CONSOLE_PORT}:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 8
minio-init:
image: minio/mc:latest
container_name: cloud-fullstack-docker-minio-init
depends_on:
minio:
condition: service_healthy
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
UPLOAD_BLOB_BACKEND: ${UPLOAD_BLOB_BACKEND}
UPLOAD_BLOB_BUCKET: ${UPLOAD_BLOB_BUCKET}
UPLOAD_BLOB_POLICY: ${UPLOAD_BLOB_POLICY}
volumes:
- ./scripts/minio-init.sh:/usr/local/bin/minio-init.sh:ro
entrypoint: ["/bin/sh", "/usr/local/bin/minio-init.sh"]
restart: "no"
r-engine:
build:
context: .
dockerfile: services/r-engine/Dockerfile
args:
R_ENGINE_CRAN_REPO: ${R_ENGINE_CRAN_REPO:-https://cloud.r-project.org}
R_ENGINE_INSTALL_ENRICHMENT_PACKAGES: ${R_ENGINE_INSTALL_ENRICHMENT_PACKAGES:-0}
container_name: cloud-fullstack-docker-r-engine
ports:
- "${R_ENGINE_PORT}:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 10
api:
build:
context: ./services/api
dockerfile: Dockerfile
container_name: cloud-fullstack-docker-api
environment:
PORT: 4000
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_NAME: ${POSTGRES_DB}
REDIS_HOST: redis
REDIS_PORT: 6379
JOB_QUEUE_MODE: ${JOB_QUEUE_MODE:-bullmq}
JOB_STORE_MODE: ${JOB_STORE_MODE:-postgres}
R_ENGINE_URL: http://r-engine:8000
UPLOAD_BLOB_BACKEND: ${UPLOAD_BLOB_BACKEND}
UPLOAD_BLOB_DIR: /app/reports
UPLOAD_BLOB_BUCKET: ${UPLOAD_BLOB_BUCKET}
UPLOAD_BLOB_PREFIX: ${UPLOAD_BLOB_PREFIX}
UPLOAD_BLOB_ENDPOINT: ${UPLOAD_BLOB_ENDPOINT}
UPLOAD_BLOB_REGION: ${UPLOAD_BLOB_REGION}
UPLOAD_BLOB_ACCESS_KEY_ID: ${UPLOAD_BLOB_ACCESS_KEY_ID}
UPLOAD_BLOB_SECRET_ACCESS_KEY: ${UPLOAD_BLOB_SECRET_ACCESS_KEY}
UPLOAD_BLOB_FORCE_PATH_STYLE: ${UPLOAD_BLOB_FORCE_PATH_STYLE}
ports:
- "${API_PORT}:4000"
volumes:
- ./services/api:/app
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
r-engine:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:4000/api/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 15s
timeout: 5s
retries: 10
frontend:
build:
context: ./services/frontend
dockerfile: Dockerfile
container_name: cloud-fullstack-docker-frontend
environment:
VITE_API_URL: http://localhost:${API_PORT}
ports:
- "${FRONTEND_PORT}:5173"
volumes:
- ./services/frontend:/app
- /app/node_modules
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:5173"]
interval: 15s
timeout: 5s
retries: 10
volumes:
pgdata:
redis_data:
minio_data: