-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-compose.yml
49 lines (45 loc) · 3.43 KB
/
local-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
# Docker Compose file for local deployments
version: "3.8"
services:
# Configuration for the Apache container running the Q2A site
php-apache-environment:
container_name: q2a-apache # Custom name for the q2a Apache server
build: # Build a new image
context: ./public # Source of the container
dockerfile: DockerfileNoSSL # Dockerfile to build from
image: q2a-php-apache-local # Name of the image of the Apache server being created
restart: on-failure # Restart this container if a failure occurs
depends_on: # Ensure this container starts *after* the DB container is running
- "db" # Must be the name of the database *container*
volumes: # Bind the source directory to the website container
- type: bind # Bind instead of Volume because we want to be able to make changes to the source folder without re-composing the container
source: ./public # Must be the directory containing `index.php`
target: /var/www/html/ # Default root for Apache web server
- type: bind # This bind mount allows the web server to access config information
source: ./config # without the website having direct access to those files
target: /var/www/config/ #
ports: # Define what ports should be open for traffic
- "80:80" # Open 80 on the host to allow HTTP traffic
- "443:443" # Open 443 on the host to allow HTTPS traffic
# Configuration for the Q2A database container
db:
container_name: q2a-db # Note that this is used for the `QA_MYSQL_HOSTNAME` env var in `qa-config-external.php` in the Q2A container
image: mysql # Using a mySQL database
restart: always # Always restart the container. See `https://www.cloudbees.com/blog/ensuring-containers-are-always-running-with-dockers-restart-policy` for more restart policies
environment: # Setting the mySQL environment variables
# This var is not used in `qa-config-external.php`
MYSQL_ROOT_PASSWORD: ROOT_PASSWORD_TO_REPLACE
# Name of the *database*, not the container
MYSQL_DATABASE: DATABASE_TO_REPLACE
# Username used in `qa-config-secure.php`
MYSQL_USER: USERNAME_TO_REPLACE
# Password used in `qa-config-secure.php`
MYSQL_PASSWORD: PASSWORD_TO_REPLACE
ports: # This allows us to access the MySQL database remotely (Remove after ETL)
- "9906:3306" # 3306 is default for SQL
volumes: # Volume for data persistence
- type: volume # Use a Volume over a Bind to make managing data easier
source: q2a_db_volume # This volume is located on the HOST MACHINE
target: /var/lib/mysql # Location of the MySQL database
volumes: # These volumes are stored on /var/lib/docker/volumes/ (on Linux)
q2a_db_volume: # Persistent storage for DB