Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #275

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .circleci/config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .dockerignore

This file was deleted.

51 changes: 0 additions & 51 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

56 changes: 0 additions & 56 deletions .github/ISSUE_TEMPLATE/Bug_report.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/move.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .gitignore

This file was deleted.

34 changes: 0 additions & 34 deletions .gometalinter.json

This file was deleted.

14 changes: 0 additions & 14 deletions .promu.yml

This file was deleted.

46 changes: 21 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
FROM golang:alpine as builder

# Download and install the latest release of dep
ADD https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep

# Install git because gin/yaml needs it
RUN apk update && apk upgrade && apk add git

# Copy the code from the host and compile it
WORKDIR $GOPATH/src/github.com/tellytv/telly
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure --vendor-only
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .

# install ca root certificates + listen on 0.0.0.0 + build
RUN apk add --no-cache ca-certificates \
&& find . -type f -print0 | xargs -0 sed -i 's/"listen", "localhost/"listen", "0.0.0.0/g' \
&& CGO_ENABLED=0 GOOS=linux go install -ldflags '-w -s -extldflags "-static"'

FROM scratch
COPY --from=builder /app ./
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs/
FROM ubuntu

ARG DEBIAN_FRONTEND=noninteractive
ENV LANG='C.UTF-8' LANGUAGE='C.UTF-8' LC_ALL='C.UTF-8'

# Add s6 script

ADD https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C /

# Copy S6 init scripts

COPY s6/ /etc

# Add necessary packages

RUN apt-get update && apt install -y wget xz-utils tzdata


EXPOSE 6077
ENTRYPOINT ["./app"]
VOLUME /config
ENTRYPOINT ["/init"]
Loading