cicd-github-actions/docker-compose.yml

35 lines
735 B
YAML
Raw Normal View History

2023-07-03 13:50:35 +00:00
version: '3.8'
services:
db:
image: mysql:8.0
cap_add:
- SYS_NICE
2023-07-10 10:21:31 +00:00
hostname: db
2023-07-03 13:50:35 +00:00
restart: always
environment:
- MYSQL_DATABASE=library
2023-07-10 10:21:31 +00:00
- MYSQL_RANDOM_ROOT_PASSWORD=1
- MYSQL_USER=dbuser
- MYSQL_PASSWORD=libraryDbPassword
2023-07-03 13:50:35 +00:00
ports:
- '3306:3306'
volumes:
- db:/var/lib/mysql
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
2023-07-10 10:21:31 +00:00
api:
2023-07-10 11:40:37 +00:00
image: githubactionsdemo.api:${VERSION}
2023-07-10 10:21:31 +00:00
build: .
restart: always
depends_on:
- db
ports:
- '5275:5275'
environment:
- ASPNETCORE_URLS=http://*:5275
- API_DbSettings__ConnectionString=Server=db;Database=library;Uid=dbuser;Pwd=libraryDbPassword;
2023-07-03 13:50:35 +00:00
volumes:
db:
2023-07-10 10:21:31 +00:00
driver: local