-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
95 lines (88 loc) · 2.55 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
version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: news_aggregator_app
restart: unless-stopped
working_dir: /var/www/html
volumes:
- .:/var/www/html
- ./vendor:/var/www/html/vendor
- ./node_modules:/var/www/html/node_modules
- ./docker/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- ./docker/supervisor:/etc/supervisor/conf.d
networks:
- news_aggregator
depends_on:
- mysql
- redis
webserver:
image: nginx:latest
container_name: news_aggregator_webserver
restart: unless-stopped
ports:
- "${WEB_SERVER_FORWARD_PORT:-8000}:80"
volumes:
- .:/var/www/html
- ./docker/nginx:/etc/nginx/conf.d
networks:
- news_aggregator
depends_on:
- app
mysql:
image: mysql:8.0
container_name: news_aggregator_db
restart: unless-stopped
ports:
- "${DB_FORWARD_PORT:-3306}:3306"
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- "news_aggregator_mysql:/var/lib/mysql"
networks:
- news_aggregator
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}" ]
retries: 3
timeout: 5s
redis:
image: redis:7.2.4
container_name: news_aggregator_redis
restart: unless-stopped
ports:
- "${REDIS_FORWARD_PORT:-6379}:6379"
volumes:
- "./news_aggregator_redis:/data"
networks:
- news_aggregator
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
retries: 3
timeout: 5s
swagger:
image: swaggerapi/swagger-ui
container_name: news_aggregator_swagger_ui
restart: unless-stopped
ports:
- "${SWAGGER_FORWARD_PORT:-8080}:8080"
volumes:
- "./docs:/docs"
environment:
SWAGGER_JSON_URL: ""
SWAGGER_JSON: "/docs/openapi.json"
BASE_URL: "/swagger"
networks:
- news_aggregator
networks:
news_aggregator:
driver: bridge
volumes:
news_aggregator_mysql:
driver: local
news_aggregator_redis:
driver: local