-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
116 lines (112 loc) · 2.56 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
112
113
114
115
116
version: '3'
services:
# https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose
#PHP Service
app:
image: guoxiangke/abc
links:
- db:mysql
- redis
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
CONTAINER_ROLE: app
REDIS_PORT: 6379
CACHE_DRIVER: redis
SESSION_DRIVER: redis
QUEUE_DRIVER: redis
REDIS_HOST: redis
volumes:
- code:/var/www/html/
- .env:/var/www/html/.env
- ./docker/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
- ./storage/app:/var/www/html/storage/app
networks:
- backend
# Nginx Service
nginx:
image: nginx:alpine
container_name: abc-webserver
restart: unless-stopped
volumes:
- code:/var/www/html/
- .env:/var/www/html/.env
- ./docker/nginx/conf.d/app.conf:/etc/nginx/conf.d/default.conf:ro
- ./storage/app:/var/www/html/storage/app:ro
environment:
VIRTUAL_HOST: ${DOMAIN}
LETSENCRYPT_HOST: ${DOMAIN}
LETSENCRYPT_EMAIL: ${MAIL_USERNAME}
networks:
- overlay
- backend
links:
- app
#MySQL Service
db:
image: mysql:latest
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', '--default-authentication-plugin=mysql_native_password']
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
- /tmp:/sql
environment:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: root
networks:
- backend
redis:
image: redis:latest
restart: always
networks:
- backend
scheduler:
image: guoxiangke/abc
restart: always
depends_on:
- app
links:
- db:mysql
- redis
networks:
- backend
volumes:
- ./storage/app:/var/www/html/storage/app
- .env:/var/www/html/.env
environment:
REDIS_PORT: 6379
CONTAINER_ROLE: scheduler
CACHE_DRIVER: redis
SESSION_DRIVER: redis
QUEUE_DRIVER: redis
REDIS_HOST: redis
queue:
image: guoxiangke/abc
restart: always
depends_on:
- app
links:
- db:mysql
- redis
networks:
- backend
volumes:
- ./storage/app:/var/www/html/storage/app
- .env:/var/www/html/.env
environment:
REDIS_PORT: 6379
CONTAINER_ROLE: queue
CACHE_DRIVER: redis
SESSION_DRIVER: redis
QUEUE_DRIVER: redis
REDIS_HOST: redis
#Docker Networks
networks:
overlay:
driver: bridge
backend:
volumes:
db_data:
code: