docker-compose.yml 파일이 아래와 같은데
계속 mysql 관련 에러가 뜹니다. --initialize specified but the data directory has files in it. Aborting. restart가 unless-stooped라 계속 껏다 켜집니다.
그리고 해당 사이트에 접속시 nginx 502 bad gate 에러가 뜹니다. stdin_open: true를 넣었습니다.
로그 nginx_1 | 2020/11/07 07:26:20 [error] 27#27: *1 connect() failed (113: No route to host) while connecting to upstream, client: 192.168.99.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.21.0.3:3000/favicon.ico", host: "192.168.99.100:3000", referrer: "http://192.168.99.100:3000/"
version: "3"
services:
frontend:
build:
dockerfile: Dockerfile.dev
context: ./frontend
volumes:
- /app/node_modules
- ./frontend:/app
environment:
- CHOKIDAR_USEPOLLING=true
stdin_open: true
nginx:
restart: always
build:
dockerfile: Dockerfile
context: ./nginx
ports:
- "3000:80"
backend:
build:
dockerfile: Dockerfile.dev
context: ./backend
container_name: app_backend
volumes:
- /app/node_modules
- ./backend:/app
mysql:
build:
dockerfile: Dockerfile
context: ./mysql
restart: unless-stopped
container_name: app_mysql
ports:
- "3306:3306"
volumes:
- ./mysql/mysql_data:/var/lib/mysql
- ./mysql/sqls/:/docker-entrypoint-initdb.d/
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: myapp