-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
37 lines (33 loc) · 1.1 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
version: '3.8'
services:
income-follow-up-db:
container_name: income-follow-up-db-container
image: mariadb:latest
environment:
- MYSQL_DATABASE=IncomeFollowUp
- MYSQL_ROOT_PASSWORD=<Your_password>
ports:
- "3307:3306"
healthcheck: # Check if the database is ready to accept connections
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
volumes:
- mysql_data:/var/lib/mysql
income-follow-up-app:
build:
context: .
dockerfile: Dockerfile
container_name: income-follow-up-app-container
depends_on:
income-follow-up-db:
condition: service_healthy # Wait for the database to be ready otherwise the app will fail to start when trying to connect to the database before it is ready
ports:
- "8080:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Server=income-follow-up-db;Port=3306;Database=IncomeFollowUp;User=root;Password=<Your_password>;
volumes:
mysql_data: