-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
100 lines (92 loc) · 2.86 KB
/
docker-compose.yaml
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
# docker-compose.yaml
version: '3.8'
services:
mysql:
image: mysql:${MYSQL_VERSION}
command: --default-authentication-plugin=mysql_native_password
# command: --socket=/tmp/mysql.sock --default-authentication-plugin=mysql_native_password
volumes:
- "db_data:/var/lib/mysql"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
ports:
- ${MYSQL_PORT}:3306
container_name: ${PROJECT_PREFIX}${MYSQL_HOST}
# restart: always
# https://stackoverflow.com/questions/39175194-compose-persistent-data-mysql
# https://stackoverflow.com/questions/63552052-volumes-on-wsl2-using-docker-desktop
# https://stackoverflow.com/questions/65345516-permission-denied-to-local-mysql-volume
web:
image: nginx:${NGINX_VERSION}
container_name: ${PROJECT_PREFIX}${NGINX_HOST}
ports:
- ${PUBLIC_WEB_PORT}:80
volumes:
- ../${APP_FOLDER}:/var/www
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/ssl:/etc/ssl
depends_on:
- php-fpm
- mysql
links:
- php-fpm
# networks:
# api:
# ipv4_address: 10.1.0.101
# extra_hosts:
# - "api-gateway.local:10.1.0.101"
# - "api-store.local:10.1.0.101"
command:
[nginx-debug, '-g', 'daemon off;']
php-fpm:
container_name: ${PROJECT_PREFIX}${PHP_HOST}
build:
context: ./php
volumes:
- ../${APP_FOLDER}:/var/www
- ./php/php.ini:/usr/local/etc/php/conf.d/php.ini
# - ./php-fpm/php-dev.ini:/usr/local/etc/php/conf.d/php-dev.ini
# - ./php-fpm/www.conf:/usr/local/etc/php-fpm.d/www.conf
# - /tmp/${APP_NAME}/php-fpm:/var/log/xdebug
# # - ./configs/ssh/config:/root/.ssh/config
# - ./configs/terminal/bash_aliases:/root/.bash_aliases
# - ./configs/terminal/zshrc:/root/.zshrc
# - ./configs/composer:/root/.composer
# networks:
# api:
# ipv4_address: 10.1.0.102
# extra_hosts:
# - "api-gateway.local:10.1.0.101"
# - "api-store.local:10.1.0.101"
portainer:
image: portainer/portainer
container_name: ${PROJECT_PREFIX}${PORTAINER_HOST}
ports:
- ${PORTAINER_PORT}:9000
command: -H unix:///var/run.sock
volumes:
- /var/run.sock:/var/run.sock
- "portainer_data:/data"
phpmyadmin:
container_name: ${PROJECT_PREFIX}${PHPMYADMIN_HOST}
image: phpmyadmin/phpmyadmin
ports:
- ${PHPMYADMIN_PORT}:80
environment:
- PMA_ARBITRARY=1
- PMA_HOST=${MYSQL_HOST}
depends_on:
- mysql
# networks:
# api:
# driver: bridge
# ipam:
# driver: default
# config:
# - subnet: 10.1.0.0/24
volumes:
db_data:
portainer_data: