Sioro-Neoku / go-peerflix

Go Peerflix
MIT License
470 stars 119 forks source link

Add Docker support #49

Open pataquets opened 4 years ago

pataquets commented 4 years ago

Add Dockerfile to enable image building. Useful for development and tests under Docker workflow. Using the official Golang image, latest tag. More info at https://hub.docker.com/_/golang/. No Golang install needed on systems with Docker, both for running or for developing/testing.

Just adding files, setting working dir and running build instructions, nothing fancy here.

Build:

$ docker build -t go-peerflix .

Run:

$ docker run --rm -it -p 8080:8080 go-peerflix [other options...]

Using the -pswitch to open/map ports. Add as many -poptions as needed. Alternatively, you can use --net=host to give the container full access to the local networking stack, instead of mapping ports.

FYI, there's a still quicker to test, already built image on my Docker Hub. Test it by running:

$ docker run --rm -it -p 8080:8080 pataquets/go-peerflix-src [other options...]

CTRL+C'ing stops it. Using --rm causes the container to be deleted after running.

Optional improvement to come (maybe in another issue):

pataquets commented 4 years ago

@Sioro-Neoku ping

pataquets commented 2 years ago

@Sioro-Neoku: judging by the project activity, you might be interested in https://adoptoposs.org/ or https://www.codeshelter.co/