-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
75 lines (69 loc) · 2.18 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
# Версия docker-compose
version: '3.7'
# Список наших сервисов (контейнеров)
services:
nginx:
# используем последний стабильный образ nginx
# build: ./images/nginx
image: ${DOCKER_NGINX}
container_name: ${APP_NAME}_${CONTAINER_NGINX}
# маршрутизируем порты
ports:
- ${NGINX_PORT}:80
# - 443:443
# монтируем директории, слева директории на основной машине, справа - куда они монтируются в контейнере
volumes:
- ./hosts:/etc/nginx/conf.d
- ./www:/var/www
- ./logs:/var/log/nginx
# nginx должен общаться с php контейнером
networks:
php_net:
php:
image: ${DOCKER_PHP}
# build: ./images/php
container_name: ${APP_NAME}_${CONTAINER_PHP}
volumes:
- ./www:/var/www
environment:
XDEBUG_CONFIG: remote_host=127.0.0.1
networks:
php_net:
postgres:
image: ${DOCKER_POSTGRES}
# build: ./images/postgres
container_name: ${APP_NAME}_${CONTAINER_DB}
ports:
- ${DB_PORT}:5432
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data
volumes:
- postgres:/var/lib/postgresql/data
networks:
php_net:
# mysql:
# image: ${DOCKER_MYSQL}
# container_name: ${APP_NAME}_${CONTAINER_DB}
# ports:
# - ${DB_PORT}:3306
# environment:
# MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
# volumes:
# - mysql:/var/lib/mysql
adminer:
image: ${DOCKER_ADMINER}
container_name: ${APP_NAME}_${CONTAINER_ADMINER}
ports:
- ${ADMINER_PORT}:8080
networks:
php_net:
networks:
php_net:
name: php_net
volumes:
postgres:
name: php_volume_psql
# mysql: