-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
69 lines (65 loc) · 1.67 KB
/
docker-compose.yaml
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
version: '3.8' # Updated version to use the 'depends_on' condition
networks:
python:
driver: bridge
services:
db:
image: mysql:latest
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: incognito
MYSQL_USER: root
MYSQL_PASSWORD: root
volumes:
- ./db_data:/var/lib/mysql
ports:
- "3306:3306"
networks:
- python
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
retries: 5
restart: unless-stopped
runtestcases:
build:
context: ./utils # Folder where the Dockerfile for runtestcases is located
dockerfile: Dockerfile
container_name: runtestcases
networks:
- python
volumes:
- ./utils:/app # Optional, mounting utils folder inside the container
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: root
DB_NAME: incognito
command: ["echo", "runtestcases build complete"] # Build but do not run
depends_on:
- db
webapplication:
build:
context: .
dockerfile: Dockerfile # Assuming the Dockerfile is in the root directory
container_name: incognito
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: root
DB_NAME: incognito
networks:
- python
ports:
- "5001:5001"
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
db:
condition: service_healthy # Ensure db is fully up before starting
runtestcases:
condition: service_started # Ensure runtestcases has been built first