GithubHelp home page GithubHelp logo

cheatsheet-docs's Introduction

Homebrew

$ brew install --cask file

$ brew update && brew upgrade

Docker

Container?

A container is simply another process on your machine that has been isolated from all other processes on the host machine.

Run
$ 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
Shorthand
$ docker run -dp 80:80 docker/docker-name
Building the App's Container Image
  1. Create a file named Dockerfile
FROM node:12-alpine
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
  1. 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.

Starting an App Container
$ docker run -dp 3000:3000 docker-name
Removing a container
$ 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>
Shorthand
$ docker rm -f <the-container-id>
Create a Volume
$ docker volume create volume-name
#mount volume
Inspect a Volume
$ docker volume inspect volume-name
Check Logs
$ docker logs -f <container-id>

NVM

#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

Git

#remove .env
$ git rm .env --cached
$ git commit -m "Stopped tracking .env File"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.