Skip to content

Instantly share code, notes, and snippets.

@GuoyiZhang
Forked from nicoavila/docker-compose.yml
Created August 29, 2024 07:32
Show Gist options
  • Save GuoyiZhang/0da91182084c4b72cd3c60e1b2d16a83 to your computer and use it in GitHub Desktop.
Save GuoyiZhang/0da91182084c4b72cd3c60e1b2d16a83 to your computer and use it in GitHub Desktop.
Docker Compose file for a MySQL 5.7 container
version: '3.3'
services:
database:
image: mysql:5.7
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- './.mysql-data/db:/var/lib/mysql'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment