-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
60 lines (49 loc) · 1.24 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
# use version 3 of the docker compose syntax
version: '3'
services:
# we named our first service 'web'
web:
hostname: mmmapi.com
# build a custom image
build:
context: .
dockerfile: Dockerfile
# a name for easier reference
image: apiexample
container_name: web
# map host port 8080 to container port 80
ports:
- 8080:80
environment:
- VIRTUAL_HOST=apiexample.com
volumes:
- /var/www/html
# add to network
networks:
- new
depends_on:
- mysql
mysql:
# use a default image
image: mysql:5.6
#container_name: mysql
networks:
new:
aliases:
- mysql
restart: always
volumes:
- ./database:/docker-entrypoint-initdb.d
# again, port mapping
ports:
- 13306:3306
# the mysql image uses these to create database and users
environment:
MYSQL_ROOT_PASSWORD:
MYSQL_DATABASE: apitest
MYSQL_USER: root
MYSQL_ALLOW_EMPTY_PASSWORD: 1
MYSQL_PASSWORD:
networks:
new:
driver: bridge