-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·83 lines (77 loc) · 1.63 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
services:
web:
image: php:7.4.28-fpm-alpine3.14
build:
context: .
dockerfile: Dockerfile
container_name: php_web
depends_on:
- db
- redis
volumes:
- ./app:/var/www/html # mount local "app" folder to container
- ./php.ini:/usr/local/etc/php/php.ini
- ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
ports:
- "8080:80"
networks:
- webnet
extra_hosts:
- "host.docker.internal:host-gateway" # Needed for Xdebug
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
API_KEY: ABCD1234
DB_HOST: db
DB_NAME: native_api
DB_USER: user
DB_PASSWORD: user
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: native_api
MYSQL_USER: user
MYSQL_PASSWORD: user
volumes:
- db_data:/var/lib/mysql
ports:
- "33060:3306" # port 3306 already in use on my local environment
networks:
- webnet
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
restart: always
depends_on:
- db
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: 'root'
ports:
- "8082:80"
networks:
- webnet
nginx:
image: nginx:alpine
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./app:/var/www/html
ports:
- "8081:80"
networks:
- webnet
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
ports:
- "6379:6379"
networks:
- webnet
networks:
webnet:
driver: bridge
volumes:
db_data: