-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (79 loc) · 3.1 KB
/
docker-compose.yml
File metadata and controls
85 lines (79 loc) · 3.1 KB
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
version: '3'
services:
db:
container_name: ${DOCKER_NAME}_db
build: ./docker/db/${DB_VERSION}
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
volumes:
- ${DB_PATH}:/var/lib/${DB_CONNECTION}
# - ./logs/db:/var/log/mysql:ro
- ./backup:/var/www/app/backup
- ./backup/init:/docker-entrypoint-initdb.d
ports:
- ${DB_PORT}:3306
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
TZ: ${DOCKER_TIMEZONE}
networks:
- default
php:
container_name: ${DOCKER_NAME}_php
build:
context: ./docker/php/${PHP_VERSION}
args:
DOCKER_PHP_VERSION: ${PHP_VERSION}
TZ: ${DOCKER_TIMEZONE}
volumes:
- ./:/var/www
# - ./logs/php:/var/log/php:ro
# Use for debug config:
# - ./docker/php/conf.d:/etc/php/7.4/fpm/conf.d
environment:
PHP_IDE_CONFIG: "serverName=Docker"
links:
- db
extra_hosts:
- ${APP_DOMAIN}:${NETWORK_INTERFACE}
- host.docker.internal:host-gateway
networks:
- default
web:
build: ./docker/${WEB_SERVER}
container_name: ${DOCKER_NAME}_web
volumes:
- ./:/var/www:ro
# For debug config:
- ./docker/nginx/conf.d:/etc/nginx/conf.d
# - ./logs/nginx:/var/log/nginx:ro
ports:
- ${WEB_PORT}:80
links:
- php
environment:
APP_DOMAIN: ${APP_DOMAIN}
TZ: ${DOCKER_TIMEZONE}
networks:
default:
ipv4_address: ${NETWORK_INTERFACE}
mailhog:
image: mailhog/mailhog
container_name: ${DOCKER_NAME}_mailhog
ports:
- 1025:1025
- 8025:8025
networks:
- default
networks:
default:
ipam:
config:
- subnet: ${NETWORK_SUBNET}
# Use a restart policy by restart
# `no` Don't automatically restart the container. (Default)
# `on-failure[:max-retries]` Restart the container if it exits due to an error, which manifests as a non-zero exit code. Optionally, limit the number of times the Docker daemon attempts to restart the container using the :max-retries option. The on-failure policy only prompts a restart if the container exits with a failure. It doesn't restart the container if the daemon restarts.
# `always` Always restart the container if it stops. If it's manually stopped, it's restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in restart policy details)
# `unless-stopped` Similar to always, except that when the container is stopped (manually or otherwise), it isn't restarted even after Docker daemon restarts.