https://github.com/samk13/node-express-docker-devops
https://github.com/samk13/node-express-docker-devops
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/samk13/node-express-docker-devops
- Owner: Samk13
- Created: 2021-07-04T15:35:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T23:58:57.000Z (almost 5 years ago)
- Last Synced: 2025-02-16T22:27:05.706Z (over 1 year ago)
- Language: JavaScript
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# How to start Docker container
## for development:
```zsh
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
```
## for production:
```zsh
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```
## take down the container:
```zsh
docker-compose down -v
```
## info:
```zsh
docker run -d -p 4000:4000 -v ${pwd}:/app -v /app/node_modules --name node-app node-app-image
```
docker explainations
-d : detach docker run from the terminal
-p : port -p 4000:4000 left side is the outside exposed container port and the right side is the inner container exposed port
-v : is a volume container path the left side is the host path and the right side is the container path
--name : is the name of the container
node-app-image : is the image name
${pwd} : is the current directory
## delete the container volume
```zsh
docker rm -fv node-app
```
-fv : force the removal of the container and the volume
## force rebuild the container with docker-compose
```zsh
docker-compose up -d --build
```
--build : force the rebuild of the container
-d : detach docker run from the terminal