Last active
November 19, 2022 15:39
-
-
Save urstoryp/cf46d93158e3d4ded1038be39fc227b4 to your computer and use it in GitHub Desktop.
docker-compse.yml (mysql 서버 실행)
This file contains 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: "2" | |
services: | |
vacation-db: | |
image: mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: "root1234" | |
MYSQL_DATABASE: "database이름" | |
MYSQL_USER: "아이디" | |
MYSQL_PASSWORD: "암호" | |
TZ: Asia/Seoul | |
command: | |
- --character-set-server=utf8mb4 | |
- --collation-server=utf8mb4_unicode_ci | |
volumes: | |
- ./database/init/:/docker-entrypoint-initdb.d/ | |
- ./database/datadir/:/var/lib/mysql | |
platform: linux/x86_64 | |
ports: | |
- 3306:3306 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /Users/urstory/devel/docker/mysql_study/database/init
와 같은 오류가 발생할 경우
❯ mkdir database
❯ mkdir database/init
❯ mkdir database/datadir
docker-compose.yml이 있는 폴더에서 위와 같이 폴더를 생성후 실행한다.