-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
101 lines (95 loc) · 2.89 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
services:
mysql:
image: mysql:8.0
container_name: mergebot-mysql
restart: always
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes" # Generate a random root password
MYSQL_DATABASE: conflict # The database to be created
MYSQL_USER: backend # Non-root user
MYSQL_PASSWORD: 123456 # Password for the non-root user
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql # Persistent storage for MySQL data
- ./ui/conflict-manager/conflict.sql:/docker-entrypoint-initdb.d/conflict.sql # Initialize DB with conflict.sql
networks:
- mergebot-network
redis:
image: redis:latest
container_name: mergebot-redis
restart: always
ports:
- "6379:6379"
networks:
- mergebot-network
mergebot-backend:
# build:
# context: .
# dockerfile: ./docker/backend/Dockerfile
image: whalien52/mergebot-backend:v1.5.2
container_name: mergebot-backend
restart: on-failure:3
ports:
- "8080:8080"
volumes:
- "${REPOS_DIR}:${REPOS_DIR}"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/conflict
SPRING_DATASOURCE_USERNAME: backend
SPRING_DATASOURCE_PASSWORD: 123456
SPRING_REDIS_HOST: redis
LOCAL_USER_ID: ${LOCAL_USER_ID}
REPOS_DIR: ${REPOS_DIR}
depends_on:
- mysql
- redis
networks:
- mergebot-network
mergebot-sa:
image: whalien52/mergebot-sa:v1.5.0
container_name: mergebot-sa
environment:
LOCAL_USER_ID: ${LOCAL_USER_ID}
REPOS_DIR: ${REPOS_DIR}
restart: on-failure:3
ports:
- "18080:18080"
volumes:
- "${REPOS_DIR}:${REPOS_DIR}" # Mount the host directory to the container
networks:
- mergebot-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:18080/api/sa/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
depends_on:
- mergebot-backend # wait for the backend to chown of REPOS_DIR
frontend:
# build:
# context: .
# dockerfile: ./docker/frontend/Dockerfile
image: whalien52/mergebot-frontend:v1.5.1
container_name: mergebot-frontend
restart: always
ports:
- "3000:80" # map the port 80 of the container to 3000 on the host
networks:
- mergebot-network
depends_on:
- mergebot-backend
- mergebot-sa
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
volumes:
mysql_data:
driver: local
networks:
mergebot-network:
driver: bridge