forked from fmfpereira/dlamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.97 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
58
59
60
61
62
63
# Docker compose file for basic environment php stack.
# Docker compose version
version: '3'
# Docker compose services.
services:
# Docker web service.
web:
# Configuration options that are applied at build time.
build:
# Using Dockerfile
context: .docker/php
# Overrides build arguments, which are environment variables accessible only during the build process.
args:
- DOCKER_PHP_VERSION=7.1
- DOCKER_APACHE_RUN_USER=www-data
- DOCKER_APACHE_RUN_GROUP=www-data
- DOCKER_APACHE_RUN_UID=33
- DOCKER_APACHE_RUN_GID=33
# Expose ports.
ports:
- "80"
# Link to containers in another service.
links:
- db:percona
# Mount host paths or named volumes.
volumes:
# Host path volume for project docroot.
- ./data/apache:/var/www/html
# Host path volume for php.ini configuration file.
- ./conf/php.ini:/usr/local/etc/php/php.ini
# Host path volume for apache default.conf file.
- ./conf/apache.conf:/etc/apache2/sites-available/000-default.conf
# Docker db service.
db:
# Specify the image to start the container from.
image: percona
# Expose ports
ports:
- "3306"
# Mount host paths or named volumes.
volumes:
# Named volume for percona data.
- percona_data:/var/lib/mysql
# Host path volume for docker-entrypoint-initdb.d folder.
# Percona import sql dumps from this folder if database is not created.
- ./data/mysql/import:/docker-entrypoint-initdb.d
# Host path volume for percona custom configuration file.
- ./conf/my.cnf:/etc/mysql/percona-server.conf.d/mysql_custom.cnf
# Add environment variables.
# Percona enviroment variables.
# Check https://hub.docker.com/_/percona/ for more information.
environment:
- MYSQL_ROOT_PASSWORD=db
- MYSQL_DATABASE=db
- MYSQL_USER=db
- MYSQL_PASSWORD=db
# Named volumes
volumes:
percona_data:
driver: "local"