Skip to content

Instantly share code, notes, and snippets.

@jlamim
Created February 6, 2017 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jlamim/fc77e38c24786935f6b6dedf8a606945 to your computer and use it in GitHub Desktop.
Save jlamim/fc77e38c24786935f6b6dedf8a606945 to your computer and use it in GitHub Desktop.
Docker Compose - CodeIgniter + Docker - Tutorial 2
# I use ENV variables to name my containers and set the ports
# to change, replate it here or in .env file
version: '2'
services:
php:
container_name: ${APP_NAME}-php
image: jlamim/php7-nginx
volumes:
- ./src:/var/www/src
links:
- database
ports:
- ${HTTP_PORT}:80
- ${HTTPS_PORT}:443
database:
container_name: ${APP_NAME}-database
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- ./data:/var/lib/mysql
ports:
- ${MYSQL_PORT}:3306
volumes:
data:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment