Update 06_bind_mounts.md (#16060)

This commit is contained in:
ZhaoqunZhong 2022-11-03 19:27:46 +08:00 committed by GitHub
parent 34c1897f18
commit dc25d40680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ So, let's do it!
- `-dp 3000:3000` - same as before. Run in detached (background) mode and create a port mapping
- `-w /app` - sets the "working directory" or the current directory that the command will run from
- `-v "$(pwd):/app"` - bind mount the current directory from the host in the container into the `/app` directory
- `-v "$(pwd):/app"` - bind mount the current directory from the host into the `/app` directory in the container
- `node:12-alpine` - the image to use. Note that this is the base image for our app from the Dockerfile
- `sh -c "yarn install && yarn run dev"` - the command. We're starting a shell using `sh` (alpine doesn't have `bash`) and
running `yarn install` to install _all_ dependencies and then running `yarn run dev`. If we look in the `package.json`,
@ -127,4 +127,4 @@ In order to prepare for production, you need to migrate your database from worki
little better. For simplicity, you'll keep with a relational database and switch your application to use MySQL. But, how
should you run MySQL? How do you allow the containers to talk to each other? You'll learn about that next!
[Multi container apps](07_multi_container.md){: .button .primary-btn}
[Multi container apps](07_multi_container.md){: .button .primary-btn}