Skip to content

Instantly share code, notes, and snippets.

@pascalandy
Created February 13, 2016 15:59
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 pascalandy/06ada9828ce8674be989 to your computer and use it in GitHub Desktop.
Save pascalandy/06ada9828ce8674be989 to your computer and use it in GitHub Desktop.
# 2016-02-11_20h18
nginx:
build: ./nginx/
ports: # 'ports' makes them accessible to the host machine
- "80:80" # published:host
links:
- "php"
volumes_from:
- "app"
php:
build: ./php/
expose: # 'expose' allows to expose some ports to the other containers only
- "9000" # This image does not expose the port 9000 by default
links:
- "mysql"
volumes_from:
- "app" # 'volume key' must be mounted inside the container as '/var/www/html' directory
app:
image: php:7.0-fpm
volumes:
- .:/var/www/html
command: "true"
mysql:
image: mysql:latest
volumes_from:
- "data"
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: project
MYSQL_USER: project
MYSQL_PASSWORD: project
data:
image: mysql:latest
volumes:
- /var/lib/mysql
command: "true"
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:8080"
links:
- "mysql"
environment:
PMA_HOST: "mysql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment