Multi Container Application
📕 Database
docker run --rm -d --network goals-net --name mongodb -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=secret -v data:/data/db mongo
📕 Backend
docker run --rm -d --name goals-backend -p 1000:80 --network goals-net -v logs:/app/logs -v /app/node_modules -v 'D:\2022년\Docker\chapter05\multi-02-finished\backend:/app' goals-node
📕 Frontend
docker run --rm -d -p 2000:3000 -it --name goals-frontend -v "D:\2022년\Docker\chapter05\multi-02-finished\frontend\src:/app/src" goals-react
기타
- 에러 'ERR_OSSL_EVP_UNSUPPORTED' 해결 방법
"start": "react-scripts start"
=> "start": "react-scripts --openssl-legacy-provider start"
"build": "react-scripts build"
=> "build": "react-scripts --openssl-legacy-provider build"
Docker 명령어
docker image prune -a
docker network create [network name]
Reference