Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (95 loc) · 3.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (95 loc) · 3.33 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
services:
# ─── API Service ──────────────────────────────────────────────────────────────
api:
build:
context: .
dockerfile: apps/api/Dockerfile
ports:
- "${API_PORT:-3001}:3001"
environment:
NODE_ENV: production
PORT: 3001
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
JWT_EXPIRATION: ${JWT_EXPIRATION:-1d}
DATABASE_PATH: /app/apps/api/data/data.db
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
MINIO_ENDPOINT: minio
MINIO_PORT: 9000
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
MINIO_BUCKET: ${MINIO_BUCKET:-avatars}
MINIO_USE_SSL: "false"
volumes:
- api-data:/app/apps/api/data
depends_on:
minio:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3001/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# ─── Web Service ──────────────────────────────────────────────────────────────
web:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
NEXT_PUBLIC_API_BASE_URL: http://api:3001
ports:
- "${WEB_PORT:-3000}:3000"
environment:
NODE_ENV: production
PORT: 3000
NEXT_PUBLIC_API_BASE_URL: http://api:3001
depends_on:
api:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# ─── MinIO Object Storage ─────────────────────────────────────────────────────
minio:
image: minio/minio:latest
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
volumes:
- minio-data:/data
command: server /data --console-address ":9001"
restart: unless-stopped
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# ─── MinIO Bucket Setup ───────────────────────────────────────────────────────
minio-setup:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD};
mc mb --ignore-existing myminio/$${MINIO_BUCKET};
mc anonymous set download myminio/$${MINIO_BUCKET};
exit 0;
"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
MINIO_BUCKET: ${MINIO_BUCKET:-avatars}
volumes:
api-data:
minio-data: