-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
89 lines (84 loc) · 2.55 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
services:
mariadb:
image: "${APP_DATABASE_IMAGE}"
container_name: "${APP_NAME}_mariadb"
restart: unless-stopped
env_file: .env
# Open port only for the host. Need for SSH tunnel to connect to database from SQL Manager like HeidiSQL
# Uncomment ports directive for using SSH tunnel, and uncomment SSH_TUNNEL_EXT_PORT var in .env file
ports:
- 127.0.0.1:${SSH_TUNNEL_EXT_PORT}:3306
# Uncomment this to reset root password and run inside container mariadb> FLUSH PRIVILEGES; ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';
#command: --skip-grant-tables
volumes:
- ./db-data:/var/lib/mysql
php:
image: "${APP_PHP_IMAGE}"
container_name: "${APP_NAME}_php"
restart: unless-stopped
depends_on:
- mariadb
working_dir: /srv/web
env_file: .env
environment:
CURRENT_UID: ${CURRENT_UID:-$DEFAULT_UID}
CURRENT_GID: ${CURRENT_GID:-$DEFAULT_GID}
volumes:
# Web root folder
- ./web/wp-core:/srv/web
# WordPress wp-content folder
- ./web/wp-content:/srv/web/wp-content
# Debug log
- ./logs/wordpress:/var/log/wordpress
# PHP ini config
- ./config/php:/usr/local/etc/php
# Share shell scripts
- ./sh:/shell:ro
nginx:
image: "${APP_NGINX_IMAGE}"
container_name: "${APP_NAME}_nginx"
restart: unless-stopped
depends_on:
- mariadb
- php
working_dir: /srv/web
env_file: .env
ports:
- "${APP_HTTP_PORT}:${APP_HTTP_PORT}"
- "${APP_HTTPS_PORT}:${APP_HTTPS_PORT}"
networks:
default:
# Add alias for nginx container to connect from other containers (node watcher for example)
aliases:
- "${APP_DOMAIN}"
volumes:
# Web root folder
- ./web/wp-core:/srv/web
# WordPress wp-content folder
- ./web/wp-content:/srv/web/wp-content
# Nginx config
- ./config/nginx:/etc/nginx/templates:ro
# SSL files
- ./config/ssl:/etc/nginx/ssl:ro
# Logs
- ./logs/nginx:/var/log/nginx
cron:
image: "${APP_CRON_IMAGE}"
container_name: "${APP_NAME}_cron"
restart: unless-stopped
depends_on:
- mariadb
- php
env_file: .env
volumes:
# Share docker socket to allow cron run scenarios inside other containers
- /var/run/docker.sock:/var/run/docker.sock:ro
# Share crontabs files into tmp folder
- ./config/crontabs:/tmp/crontabs
# Backups folder
- ./backups:/srv/backups
# Share shell scripts
- ./sh:/shell:ro
networks:
project_network:
driver: bridge