-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
102 lines (95 loc) · 2.5 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
102 lines (95 loc) · 2.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
x-minio-config: &x-minio-config
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY}
MINIO_SERVER_URL: ${S3_ENDPOINT}
services:
web:
image: ghcr.io/phakphum-dev/otog-web:latest
environment:
# https://github.com/vercel/next.js/pull/44627
- HOSTNAME=0.0.0.0
networks:
- api-gateway
env_file:
- apps/web/.env.production
- apps/web/.env.local
api:
image: ghcr.io/phakphum-dev/otog-api:latest
networks:
- api-gateway
- otog-network
volumes:
- ./apps/api/volumes/upload:/app/volumes/upload:rw
- ./apps/api/docs:/app/docs:rw
- ./apps/api/source:/app/source:rw
depends_on:
minio:
condition: service_healthy
postgres:
condition: service_healthy
create-bucket:
condition: service_completed_successfully
postgres:
image: postgres:14
container_name: otog-postgres
restart: unless-stopped
environment:
PGPORT: ${DB_PORT}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- ${DB_PORT}:${DB_PORT}
env_file:
- .env
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USERNAME}']
interval: 5s
timeout: 5s
retries: 5
networks:
- otog-network
minio:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
container_name: otog-minio
ports:
- '9000:9000'
- '9001:9001'
volumes:
- ./volumes/minio:/data
environment:
<<: *x-minio-config
command: server --console-address ":9001" /data
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 3s
timeout: 5s
retries: 10
networks:
- api-gateway
- otog-network
create-bucket:
image: minio/mc
container_name: otog-create-bucket
environment:
<<: *x-minio-config
S3_ENDPOINT_URL: http://otog-minio:9000
BUCKET_NAME: otog
entrypoint: >
bash -c '
echo "[mc] Alias server" &&
/usr/bin/mc alias set myminio $${S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD} &&
echo "[mc] Create $${BUCKET_NAME} bucket" &&
/usr/bin/mc mb myminio/$${BUCKET_NAME} --ignore-existing'
depends_on:
minio:
condition: service_healthy
networks:
- otog-network
networks:
otog-network:
name: otog-network
api-gateway:
external: true