Created
January 27, 2023 20:40
-
-
Save duanyrf/5d1534a588368d8fa47753c5454b64e3 to your computer and use it in GitHub Desktop.
docker-compose for MySQL latest docker image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
db: | |
image: mysql:latest | |
environment: | |
MYSQL_DATABASE: database-name | |
MYSQL_ROOT_PASSWORD: your_root_password | |
MYSQL_USER: a_common_user | |
MYSQL_PASSWORD: password_for_user | |
ports: | |
- 3306:3306 | |
volumes: | |
- ./data/database_volume:/var/lib/mysql | |
# local dir: ./data/database_volume | |
# container dir: /var/lib/mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment