Skip to content

Instantly share code, notes, and snippets.

@bretanac93
Last active November 28, 2017 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bretanac93/828b82bcbce05855926737a6aa1491f5 to your computer and use it in GitHub Desktop.
Save bretanac93/828b82bcbce05855926737a6aa1491f5 to your computer and use it in GitHub Desktop.
Docker compose file for Deploying PHP Applications
version: '3'
services:
php:
image: php:fpm
volumes:
- ./code:/code
web:
image: nginx
ports:
- "8080:80"
volumes:
- ./code:/code
- ./nginx/app.conf:/etc/nginx/conf.d/app.conf
- ./server_logs:/var/log/nginx
environment:
- DB_HOST=db
- DB_PORT=3306
- DB_DATABASE=the_db
- DB_USERNAME=root
- DB_PASSWORD=TheMegaPassword
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=TheMegaPassword
- MYSQL_DATABASE=the_db
volumes:
- ./db_data:/var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment