Skip to content

Instantly share code, notes, and snippets.

@slgithub
Created January 6, 2018 23:42
Show Gist options
  • Save slgithub/259793e4d39408ee1fb7500e383c4a1a to your computer and use it in GitHub Desktop.
Save slgithub/259793e4d39408ee1fb7500e383c4a1a to your computer and use it in GitHub Desktop.
version: '3'
services:
mysqldb:
image: mysql
container_name: ${MYSQL_HOST}
restart: always
env_file:
- ".env"
#.env is the file for configuration which include
#MYSQL_HOST=mysql
#MYSQL_DATABASE=test
#MYSQL_ROOT_USER=root
#MYSQL_ROOT_PASSWORD=root
#MYSQL_USER=dev
#MYSQL_PASSWORD=dev
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
ports:
- "8989:3306"
volumes:
- "./data/db/mysql:/var/lib/mysql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment