$ brew install --cask file
$ brew update && brew upgrade
A container is simply another process on your machine that has been isolated from all other processes on the host machine.
$ docker run -d -p 80:80 docker/docker-name
- -d - run the container in detached mode (in the background)
- -p 80:80 - map port 80 of the host to port 80 in the container
- docker/docker-name - the image to use
$ docker run -dp 80:80 docker/docker-name
- Create a file named
Dockerfile
FROM node:12-alpine
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
- Build the container image using the
docker build
command.
$ docker build -t docker-name .
The -t
flag tags image. The .
at the end of the docker build
command tells that Docker should look for the Dockerfile
in the current directory.
$ docker run -dp 3000:3000 docker-name
$ docker ps #get id of container
$ docker stop <the-container-id> # Swap out <the-container-id> with the ID from docker ps
$ docker rm <the-container-id>
$ docker rm -f <the-container-id>
$ docker volume create volume-name
#mount volume
$ docker volume inspect volume-name
$ docker logs -f <container-id>
#generate a .nvmrc file
$ node -v > .nvmrc
$ nvm ls #check node version installed on machine
$ nvm install --lts
$ nvm install node
$ nvm use node_version
$ nvm uninstall node_version
#remove .env
$ git rm .env --cached
$ git commit -m "Stopped tracking .env File"