Deploy With Docker - kimschles/schlesinger-knowledge GitHub Wiki

Docker has images of all runtime envrionments so there's no need to set up an env locally A dockerfile defines what goes into the container's envrionment

Accessing the name of the host when inside a container retrieves the container ID, which is like the process ID for a running executable.

To run a container locally

  • docker run -p 4000:8080 <name_here>

To run a container in detached mode (so you get your terminal back)

  • docker run -d -p 4000:8080 <name_here>

To get the container id

  • docker container ls

To stop a container

  • docker conatiner stop <ID_HERE>

port transformation 80:3000 host first: then container

-P vs -p -d

in a Dockerfile, exec makes the process you specify pid 1

Run a container and add current project

  • docker run -v $PWD:/app -i -t --entrypoint=/bin/bash <name_of_image>
⚠️ **GitHub.com Fallback** ⚠️