-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
108 lines (102 loc) · 3.52 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
services:
postgres:
image: postgres
environment:
POSTGRES_DB: ${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_DB}
POSTGRES_USER: ${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_USER}
POSTGRES_PASSWORD: ${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_PASSWORD}
env_file:
- .env
volumes:
- ./postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
minio:
image: quay.io/minio/minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ROOT_PASSWORD}
env_file:
- .env
volumes:
- ./minio-data:/data
ports:
- "9000:9000"
- "9001:9001"
networks:
- app-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
minio-init:
image: minio/mc
depends_on:
minio:
condition: service_healthy
environment:
MINIO_ROOT_USER: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ROOT_PASSWORD}
MINIO_ACCESS_KEY_ID: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ACCESS_KEY_ID}
MINIO_SECRET_ACCESS_KEY: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_SECRET_ACCESS_KEY}
MINIO_BUCKET_NAME: ${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_BUCKET_NAME}
env_file:
- .env
networks:
- app-network
entrypoint: >
/usr/bin/env sh -c '
sleep 10 &&
mc alias set myminio http://minio:9000 "$${MINIO_ROOT_USER}" "$${MINIO_ROOT_PASSWORD}" &&
mc mb "myminio/$${MINIO_BUCKET_NAME}" &&
mc admin accesskey create myminio/ --access-key "$${MINIO_ACCESS_KEY_ID}" --secret-key "$${MINIO_SECRET_ACCESS_KEY}"
'
backend:
image: blocklune/csapp-lab-management-system-api
environment:
- CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_URL=jdbc:postgresql://postgres:5432/${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_DB}
- CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_USERNAME=${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_USER}
- CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_PASSWORD=${CSAPP_LAB_MANAGEMENT_SYSTEM_POSTGRES_PASSWORD}
- CSAPP_LAB_MANAGEMENT_SYSTEM_S3_ENDPOINT=http://minio:9000
- CSAPP_LAB_MANAGEMENT_SYSTEM_S3_BUCKET_NAME=${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_BUCKET_NAME}
- CSAPP_LAB_MANAGEMENT_SYSTEM_S3_REGION=auto
- CSAPP_LAB_MANAGEMENT_SYSTEM_S3_ACCESS_KEY_ID=${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_ACCESS_KEY_ID}
- CSAPP_LAB_MANAGEMENT_SYSTEM_S3_SECRET_ACCESS_KEY=${CSAPP_LAB_MANAGEMENT_SYSTEM_MINIO_SECRET_ACCESS_KEY}
- CSAPP_LAB_MANAGEMENT_SYSTEM_INIT_TEACHER_USERNAME=${CSAPP_LAB_MANAGEMENT_SYSTEM_INIT_TEACHER_USERNAME}
- CSAPP_LAB_MANAGEMENT_SYSTEM_INIT_TEACHER_PASSWORD=${CSAPP_LAB_MANAGEMENT_SYSTEM_INIT_TEACHER_PASSWORD}
env_file:
- .env
depends_on:
- postgres
- minio-init
ports:
- "8080:8080"
networks:
- app-network
restart: unless-stopped
frontend:
image: blocklune/csapp-lab-management-system
depends_on:
- backend
ports:
- "3000:3000"
networks:
- app-network
restart: unless-stopped
volumes:
postgres-data:
minio-data:
networks:
app-network:
driver: bridge