forked from GaryClarke/docker-php
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
37 lines (36 loc) · 1003 Bytes
/
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
services:
# nginx
web:
image: garyclarke/nginx-php:1.0
ports:
- "80:80"
# php
app:
image: garyclarke/php-composer:1.2
environment:
MYSQL_HOST: db
MYSQL_PORT: ${MYSQL_PORT}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
REDIS_HOST: cache
REDIS_PORT: ${REDIS_PORT}
extra_hosts:
# Ensure that host.docker.internal is correctly defined on Linux
- host.docker.internal:host-gateway
# mysql
db:
image: mysql:8.0
volumes:
- mysqldata:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
# redis
cache:
image: redis:latest
volumes:
mysqldata: