-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
92 lines (85 loc) · 2.43 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
version: "3"
# Services
services:
# NGINX Service
webserver-nginx:
image: "${REGISTRY_HOST}/company-yii2-blog-web-server"
build:
context: "./nginx"
dockerfile: "Dockerfile"
container_name: webserver-nginx
ports:
- "${WEB_SERVER_PORT}:80"
volumes:
- "./yii2/:/var/www/html"
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/ssl/:/etc/nginx/ssl/
depends_on:
- php-yii2
networks:
- company-network
# Adminer Service
adminer:
image: "${REGISTRY_HOST}/company-yii2-blog-adminer"
build:
context: "./adminer/"
dockerfile: "Dockerfile"
container_name: adminer
depends_on:
- db
environment:
ADMINER_DEFAULT_SERVER: db
ADMINER_DEFAULT_DB_DRIVER: mysql
ADMINER_DEFAULT_DB_HOST: mysql
ADMINER_DEFAULT_DB_NAME: adminer
ADMINER_DESIGN: nette
ADMINER_PLUGINS: tables-filter tinymce
ports:
- "${ADMINER_PORT}:8080"
# MYSQL Service
db:
image: "${REGISTRY_HOST}/company-yii2-blog-db"
build:
context: "./mysql/"
dockerfile: "Dockerfile"
container_name: db
tty: false
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- company-volumes:/var/lib/mysql/
- ./mysql/my.cnf:/etc/mysql/my.cnf
networks:
- company-network
ports:
- ${DB_PORT}:3306
# PHP App Service
php-yii2:
image: "${REGISTRY_HOST}/company-yii2-blog-php-yii2"
build:
context: "."
dockerfile: "./php/Dockerfile"
container_name: php-yii2
tty: true
working_dir: /var/www/html
env_file:
- .env
volumes:
- "./yii2/:/var/www/html"
- "./README.md:/var/www/html/README.md"
networks:
- company-network
depends_on:
- db
# Docker Networks
networks:
company-network:
driver: bridge
# Docker Volumes
volumes:
company-volumes:
driver: local