-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
42 lines (38 loc) · 1.01 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
version: "3.8"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
# you don't need ports mapped for this to work
# but if you want to connect for troubleshooting and stuff you can map a port to the host
ports:
- "3306:3306"
#see .env file
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${HOTEL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
phpapp:
depends_on:
- db
build:
context: docker
dockerfile: apache.dockerfile
#apache with php docker image version 2.4
volumes:
# you could map custom plugins and themes here too.
# directory path on left: Container path on right
- ./PHP-Hotel-App:/var/www/html/
ports:
- "8081:80"
restart: always
environment:
HOTEL_DATABASE: ${HOTEL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
DB_HOST: db
volumes:
db_data: { }