-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
131 lines (127 loc) · 2.81 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
version: "3.7"
services:
#PHP Service
app:
build:
context: .
dockerfile: Dockerfile
image: laravel-app
container_name: app
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: app
SERVICE_TAGS: dev
extra_hosts:
- "internal.host:host-gateway"
networks:
- laravel-network
working_dir: /var/www
volumes:
- ./app:/var/www
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
#Nginx Service
webserver:
image: nginx:alpine
container_name: webserver
tty: true
ports:
- "80:80"
- "443:443"
volumes:
- ./app:/var/www
- ./nginx/conf/:/etc/nginx/conf.d/
#certbot volumes
- ./certbot/www:/var/www/certbot/
- ./certbot/conf/:/etc/nginx/ssl/
restart: on-failure
depends_on:
- app
- db
networks:
- laravel-network
#Certbot Service
certbot:
image: certbot/certbot:latest
volumes:
- ./app:/var/www/
- ./certbot/www/:/var/www/certbot/
- ./certbot/conf/:/etc/letsencrypt/
command: certonly --webroot --webroot-path /var/www/certbot/ --force-renewal --email [email protected] -d test.domain.com --agree-tos
networks:
- laravel-network
#supervisor Service
supervisor:
image: laravel-app
container_name: supervisor
networks:
- laravel-network
depends_on:
- app
- webserver
volumes:
- ./app:/var/www
- ./supervisor/supervisord.conf:/etc/supervisor/supervisord.conf
entrypoint:
["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
#- supervisord
#- supervisorctl start all
#MySQL Service
db:
image: mysql:8.0.30
container_name: db
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: laravel
MYSQL_PASSWORD: laravel
MYSQL_ROOT_PASSWORD: laravel
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql/
- ./mysql/my.cnf:/etc/mysql/my.cnf
networks:
- laravel-network
#Redis Service
# redis:
# image: redis
# container_name: redis
# restart: unless-stopped
# tty: true
# ports:
# - "6379:6379"
# networks:
# - laravel-network
cron:
build:
context: .
dockerfile: cron.dockerfile
container_name: cron
volumes:
- ./app:/var/www
networks:
- laravel-network
artisan:
build:
context: .
dockerfile: artisan.dockerfile
container_name: artisan
volumes:
- ./app:/var/www
depends_on:
- db
working_dir: /var/www
entrypoint: ["php", "/var/www/artisan"]
networks:
- laravel-network
#Docker Networks
networks:
laravel-network:
driver: bridge
#Volumes
volumes:
dbdata:
driver: local