-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
111 lines (104 loc) · 2.68 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '2.4'
services:
fpm:
build:
context: ./build
dockerfile: Dockerfile-fpm
container_name: ${APP_NAME}_fpm
hostname: ${APP_NAME}_fpm
restart: always
depends_on:
- db
volumes:
- ./data/cloudlog:/var/www/
web:
build:
context: ./build
dockerfile: Dockerfile-web
container_name: ${APP_NAME}_web
hostname: ${APP_NAME}_web
restart: unless-stopped
expose:
- 8080/tcp
depends_on:
- fpm
environment:
- VIRTUAL_HOST=${APP_HOSTNAME}
- VIRTUAL_PORT=8080
- HSTS=off
- LETSENCRYPT_HOST=${APP_HOSTNAME}
- LETSENCRYPT_TEST=${TEST}
volumes:
- ./data/cloudlog:/var/www
db:
container_name: ${APP_NAME}_db
hostname: ${APP_NAME}_db
image: mysql:5.7
restart: always
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ./data/db:/var/lib/mysql
- ./data/backup:/backup
- ./data/initdb.d:/docker-entrypoint-initdb.d
# redis:
# image: redis:5.0-alpine
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# volumes:
# - ./data/redis:/data
proxy:
container_name: ${APP_NAME}_proxy
hostname: ${APP_NAME}_proxy
image: jwilder/nginx-proxy
restart: always
ports:
# Bind to specific IP
#- 10.1.1.1:80:80
#- 10.1.1.1:443:443
# Bind to any IP on host
- ${HTTP_PORT}:80
- ${HTTPS_PORT}:443
volumes:
- ./data/conf.d:/etc/nginx/conf.d
- ./data/vhost.d:/etc/nginx/vhost.d
- ./data/html:/usr/share/nginx/html
- ./data/certs:/etc/nginx/certs
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
- DEFAULT_HOST=${APP_HOSTNAME}
cron:
container_name: ${APP_NAME}_cron
hostname: ${APP_NAME}_cron
build:
context: ./build
dockerfile: Dockerfile-cron
restart: always
environment:
- MYSQL_HOST=${APP_NAME}_db
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ./data/cron.d:/etc/cron.d
- ./data/backup:/backup
- ./data/cloudlog:/cloudlog
letsencrypt:
container_name: ${APP_NAME}_le
hostname: ${APP_NAME}_le
image: jrcs/letsencrypt-nginx-proxy-companion
volumes_from:
- proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- DEFAULT_EMAIL=${EMAIL}
restart: always
#networks:
# default:
# driver_opts:
# com.docker.network.bridge.name: dock-${APP_NAME}