-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
executable file
·73 lines (67 loc) · 1.6 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
version: '3'
services:
#PHP Service
php:
build:
context: .
dockerfile: php.dockerfile
image: ${COMPOSE_PROJECT_NAME}-php:8.1-fpm
# Remember to open conf/nginx/app.conf to change fastcgi_pass to this container_name
container_name: ${COMPOSE_PROJECT_NAME}-php
command: sh -c "chown user -R /var/www && chmod 775 -R /var/www && php-fpm"
restart: unless-stopped
tty: true
working_dir: /var/www
volumes:
- ./src:/var/www
- ./conf/php:/usr/local/etc/php/conf.d
- ./conf/php-fpm.d:/usr/local/etc/php-fpm.d
networks:
- app-network
#Nginx Service
nginx:
image: nginx:alpine
container_name: ${COMPOSE_PROJECT_NAME}-nginx
restart: unless-stopped
tty: true
ports:
- ${WEB_PORT}:80
volumes:
- ./src:/var/www
- ./conf/nginx:/etc/nginx/conf.d/
networks:
- app-network
#MySQL Service
mysql:
image: mysql:8.0
container_name: ${COMPOSE_PROJECT_NAME}-mysql
restart: unless-stopped
tty: true
environment:
MYSQL_DATABASE: data
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mysql-data:/var/lib/mysql/
networks:
- app-network
#phpMyAdmin
phpMyAdmin:
image: phpmyadmin/phpmyadmin:latest
container_name: ${COMPOSE_PROJECT_NAME}-phpmyadmin
restart: unless-stopped
ports:
- ${PMA_PORT}:80
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
networks:
- app-network
external_links:
- mysql:db
#Docker Networks
networks:
app-network:
driver: bridge
#Volumes
volumes:
mysql-data:
driver: local