From 20c63b3edf330e270bd985465a9b993fc9c91328 Mon Sep 17 00:00:00 2001 From: David Tahir Date: Wed, 15 Dec 2021 05:58:42 +0100 Subject: [PATCH] added docker support #3 --- .dockerignore | 3 +++ .gitignore | 3 +++ Dockerfile | 13 +++++++++++++ README.md | 17 +++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4c5c77e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +.vscode +build \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3c964d5..0c7298f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Coding +.vscode + # Binaries for programs and plugins *.exe *.exe~ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b82e02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.15-alpine + +LABEL maintainer="Kadrim " + +WORKDIR /proxy4plex +ADD . . + +RUN go build + +EXPOSE 80 +EXPOSE 3000 + +CMD [ "./proxy4plex" ] \ No newline at end of file diff --git a/README.md b/README.md index 271e935..3ce6b9e 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,23 @@ To compile a binary for your currently running system, simply run this command: To compile for all possible architectures you can run the command `go-build-all.sh` from a bash terminal (works also on windows in a git-bash terminal). The output binaries will be put into the directory `build/` +## Docker + +You can easily run this proxy as a Docker container: + +* Pull docker image and run: +``` +docker pull kadrim/proxy4plex +docker run -it -p 80:80 -p 3000:3000 --rm kadrim/proxy4plex +``` +or + +* Build and run container from source: +``` +docker build -t proxy4plex . +docker run -it -p 80:80 -p 3000:3000 --rm proxy4plex +``` + ## TODOs - detect OS and allow User to install the proxy as a boot-service