phpvms/docker-compose.yml

53 lines
1.1 KiB
YAML
Raw Normal View History

---
version: '3'
services:
app:
build:
context: ./docker/php
environment:
DB_HOST: mysql
2019-05-12 23:51:06 +08:00
REDIS_HOST: redis
volumes:
- ./:/var/www
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
depends_on:
2019-05-12 23:51:06 +08:00
- nginx
- mysql
2019-05-12 23:51:06 +08:00
- redis
nginx:
2019-05-12 23:51:06 +08:00
image: nginx:1.15.12-alpine
2019-05-13 00:20:42 +08:00
command: /bin/sh -c "exec nginx -g 'daemon off;'"
volumes:
- ./:/var/www
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
mysql:
image: mysql:5.7.26
environment:
2019-05-11 07:55:24 +08:00
MYSQL_DATABASE: phpvms
MYSQL_USER: phpvms
MYSQL_PASSWORD: phpvms
MYSQL_ROOT_PASSWORD:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
2019-05-11 07:55:24 +08:00
- ./docker/data/mysql:/var/lib/mysql
ports:
2019-05-11 07:55:24 +08:00
- 3306:3306
2019-05-11 08:31:11 +08:00
2019-05-12 23:51:06 +08:00
redis:
image: redis:5.0.4-alpine
2019-05-11 08:31:11 +08:00
# Use this to tail the logs so it's just all in a single window
logs:
image: busybox
2019-05-11 22:14:31 +08:00
command: tail -f -F -n 0 /var/www/storage/logs/laravel.log
2019-05-11 08:31:11 +08:00
restart: always
volumes:
2019-05-11 22:20:05 +08:00
- ./storage:/var/www/storage
2019-05-11 08:31:11 +08:00
depends_on:
- app