forked from codestellar/Docker-compose-dotnet-core-and-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (33 loc) · 826 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
34 lines (33 loc) · 826 Bytes
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
version: '3'
services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: myPass
volumes:
- data:/var/lib/mysql
- ./Db/prepare.sql:/docker-entrypoint-initdb.d/prepare.sql:ro
ports:
# This maps localhost:3001 to db:3306
# container to container will still use port 3306
# This way development on the host machine can use localhost instead of container's ip
# and a non-standard port in case the host machine has mysql installed.
- '3001:3306'
app:
environment:
DB_SERVER: db
DB_NAME: product-db
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: myPass
build:
context: .
dockerfile: Aspnetcoreapp/Dockerfile
ports:
- 8080:80
depends_on:
- db
volumes:
data:
driver: local
name: db_data