Instantly share code, notes, and snippets.

Embed
What would you like to do?
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