From 460ec310731de13b58413561a605601e44305d81 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Jacquier Date: Wed, 27 Feb 2019 15:00:26 +0100 Subject: [PATCH] Add docker compose and dockerfile Signed-off-by: Pierre-Emmanuel Jacquier --- Dockerfile | 11 +++++++++++ docker-compose.yml | 24 ++++++++++++++++++++++++ iptv/.gitkeep | 0 3 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 iptv/.gitkeep diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f3dbcd1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.11.5-alpine + +WORKDIR /go/src/github.com/pierre-emmanuelJ/iptv-proxy +COPY . . +RUN GO111MODULE=off CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o iptv-proxy . + +FROM alpine:latest +RUN apk --no-cache add ca-certificates +WORKDIR /root/ +COPY --from=0 /go/src/github.com/pierre-emmanuelJ/iptv-proxy/iptv-proxy . +CMD ["./iptv-proxy"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..298745a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3" +services: + iptv-proxy: + build: + context: . + dockerfile: Dockerfile + volumes: + # If your are using local m3u file instead of m3u remote file + # put your m3u file in this folder + - ./iptv:/root/iptv + container_name: "iptv-proxy" + restart: on-failure + # have to be the same as ENV variable PORT + ports: + - 8080:8080 + environment: + # if you are using m3u remote file + # M3U_URL: https://example.com/iptvfile.m3u + M3U_URL: /root/iptv/iptv.m3u + # Port to expose the IPTVs endpoints + PORT: 8080 + # Hostname or IP to expose the IPTVs endpoints (for machine not for docker) + HOSTNAME: localhost + diff --git a/iptv/.gitkeep b/iptv/.gitkeep new file mode 100644 index 0000000..e69de29