Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active April 13, 2024 02:34
Show Gist options
  • Save juanpablocs/bc207757fd1f0e1ff8d6fe3679e5c860 to your computer and use it in GitHub Desktop.
Save juanpablocs/bc207757fd1f0e1ff8d6fe3679e5c860 to your computer and use it in GitHub Desktop.
Docker run vps

Docker run web

first create Dockerfile second build 3 push on registry github or vultr

Docker nginx basic

FROM nginx:latest

RUN echo "<h1>Hello</h1>" > /usr/share/nginx/html/index.html

Build

image registry example:

  • ghcr.io/juanpablocs/nginx:2.0.0
  • sjc.vultrcr.com/chusan/nginx:2.0.0
docker buildx build --platform linux/amd64 -t [image:tag] -f Dockerfile .

Push

in your localy or github actions

docker push [image:tag]

Pull

pull on the final server

docker pull [image:tag]

Run

docker run -it --rm -d -p 80:80 --name web [image:tag] --restart always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment