Skip to content

Instantly share code, notes, and snippets.

@urstoryp
Last active November 19, 2022 15:39
Show Gist options
  • Save urstoryp/cf46d93158e3d4ded1038be39fc227b4 to your computer and use it in GitHub Desktop.
Save urstoryp/cf46d93158e3d4ded1038be39fc227b4 to your computer and use it in GitHub Desktop.
docker-compse.yml (mysql 서버 실행)
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
@urstoryp
Copy link
Author

urstoryp commented Nov 3, 2022

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이 있는 폴더에서 위와 같이 폴더를 생성후 실행한다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment