-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
152 lines (139 loc) · 3.51 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "3.3"
services:
#
# Database service
#
db:
image: mariadb:latest
restart: always
volumes:
- ./.db-data:/var/lib/mysql/
- ./.dumps:/docker-entrypoint-initdb.d
ports:
- "3306:3306"
environment:
- MYSQL_USER=enso
- MYSQL_PASSWORD=b66772bc
- MYSQL_DATABASE=enso
- MYSQL_ROOT_PASSWORD=b66772bc
#
# Redis service
#
redis:
image: redis:latest
container_name: redis
restart: always
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./.redis-data:/data
#
# PHP-FPM (port 9000) and RoadRunner (port 9666) services
#
php:
build:
context: ./php
dockerfile: Dockerfile
user: "1000:33"
container_name: php
stdin_open: true
working_dir: /var/www/html
restart: unless-stopped
env_file:
- ./.env
volumes:
- ./.env:/var/www/html/.env:ro
- ./.composer-cache:/root/.composer/cache:delegated
- ./php/php.ini:/usr/local/etc/php/php.ini:ro
- ./enso-psr:/var/www/html
- ./README.md:/var/www/html/docs/README.md
- ./wait-for-it.sh:/wait-for-it.sh:ro
expose:
- "9000"
- "9666"
ports:
- "8282:9666" # allow direct access to RR service
command: >
bash -c "true
&& composer install -o
&& ./rr-serve.sh
&& docker-php-entrypoint php-fpm
"
extra_hosts:
- "host.docker.internal:host-gateway" # for use in XDebug client_host
#
# Swoole HTTP Server service
#
php-sw:
build:
context: ./php
dockerfile: Dockerfile.cli
user: "1000:33"
container_name: php-sw
working_dir: /var/www/html
restart: unless-stopped
env_file:
- ./.env
volumes:
- ./.env:/var/www/html/.env:ro
- ./.composer-cache:/root/.composer/cache:delegated
- ./php/php-sw.ini:/usr/local/etc/php/php.ini:ro
- ./enso-psr:/var/www/html
- ./README.md:/var/www/html/docs/README.md
- ./wait-for-it.sh:/wait-for-it.sh:ro
expose:
- "9999"
ports:
- "8181:9999"
command: >
bash -c "true
&& docker-php-entrypoint ./enso-sw
"
#
# front Nginx for proxying all servers: FPM (port 80) and Swoole (port 81) and RoadRunner (port 82)
# except static files
#
# certbot:
# container_name: certbot
# image: certbot/certbot
# volumes:
# - ./enso-psr:/var/www/html
# - ./certbot/conf:/etc/letsencrypt
# - ./certbot/www:/var/www/certbot
# command: certonly --webroot --webroot-path=/var/www/html --email [email protected] --agree-tos --no-eff-email --staging -d sadovnikov.space
# depends_on:
# - php
# - php-sw
nginx:
image: nginx:latest
container_name: nginx
restart: unless-stopped
ports:
- "80:80" # FPM
- "81:81" # Swoole
- "82:82" # RoadRunner
# - "443:433"
volumes:
- ./enso-psr:/var/www/html:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/vhost.local.conf:/etc/nginx/conf.d/vhost.conf:ro
- ./nginx/nginx-logs:/var/log/nginx:delegated
#- ./certbot/www:/var/www/certbot:ro
depends_on:
- php
- php-sw
#
# OpenApi with Swagger UI server on port 8080
#
# open-api:
# image: swaggerapi/swagger-ui:latest
# container_name: open-api
# restart: unless-stopped
# environment:
# - SWAGGER_JSON=/app/openapi.json
# volumes:
# - ./enso-psr:/app:ro
# ports:
# - "8080:8080" # Swagger UI
# depends_on:
# - php