Skip to content

Instantly share code, notes, and snippets.

@nguyenhuucam91
Last active May 9, 2020 09:50
Show Gist options
  • Save nguyenhuucam91/a9f95ce1201628a437b0b7d872279fdf to your computer and use it in GitHub Desktop.
Save nguyenhuucam91/a9f95ce1201628a437b0b7d872279fdf to your computer and use it in GitHub Desktop.
Cấu hình Docker-compose yml chạy Nginx / Php / Mysql / Redis
version: '2'
services:
web:
container_name: docker-nginx-latest
image: nginx:latest
restart: always
ports:
- "80:80"
volumes:
- ./code:/var/www
- ./nginx:/etc/nginx/conf.d
links:
- php
- mysql
- redis
php:
build: .
container_name: docker-php7.3
restart: always
image: devilbox/php-fpm:7.3-prod
volumes:
- ./code:/var/www
- ./php/php.ini:/etc/php/7.3/fpm/php.ini
links:
- mysql
mysql:
container_name: docker-mysql
image: mysql:5.6.26
ports:
- "3306:3306"
restart: always
environment:
- MYSQL_DATABASE=ecommerce_test
- MYSQL_ROOT_PASSWORD=123456
redis:
container_name: docker-redis
image: redis
restart: always
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6379:6379'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment