-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
42 lines (39 loc) · 2.58 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:
# 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: Dockerfile # Dockerfile to build from
args: # Arguments passed into the image upon build
DOMAIN: ${DOMAIN_NAME} # Specify the domain name of the website
image: q2a-php-apache # Name of the image of the Apache server being created
restart: on-failure # Restart this container if a failure occurs
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
- ./local_certs/cert.pem:/etc/ssl/cert.pem
- ./local_certs/fullchain.pem:/etc/ssl/fullchain.pem
- ./local_certs/privkey.pem:/etc/ssl/private/privkey.pem
- ./config/qa-config-secure.php:/var/www/config/qa-config-secure.php
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 Portainer container management system
portainer:
container_name: q2a-portainer
image: portainer/portainer-ce # Note this is the free community edition
restart: always # No crashy :)
volumes: # Portainer needs to access the docker socket to modify containers
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
- /local_certs:/certs # Allow Portainer SSL certs
ports:
- "9443:9443" # HTTPS access
command: # Pass these into portainer for SSL access
--sslcert /certs/portainer.crt
--sslkey /certs/portainer.key
volumes: # These volumes are stored on /var/lib/docker/volumes/ (on Linux)
portainer_data: # For Portainer usage