Skip to content

Instantly share code, notes, and snippets.

@mdouchement
Created October 6, 2019 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdouchement/d54134613873455c6ab233c31b08c096 to your computer and use it in GitHub Desktop.
Save mdouchement/d54134613873455c6ab233c31b08c096 to your computer and use it in GitHub Desktop.
Custom Dockerfile for github.com/root-gg/plik
# build stage
FROM golang:1.13-alpine as build-env
MAINTAINER mdouchement
# Set the locale
ENV LANG c.UTF-8
# Install build dependencies
RUN apk upgrade
RUN apk add --update --no-cache \
ca-certificates \
bash \
git \
build-base \
nodejs \
nodejs-npm
RUN git clone https://github.com/root-gg/plik.git /go/src/github.com/root-gg/plik
WORKDIR /go/src/github.com/root-gg/plik
RUN make frontend
RUN make server
# final stage
FROM alpine
MAINTAINER mdouchement
RUN apk add --update --no-cache shadow ca-certificates
RUN useradd -d /opt/plik -m plik
USER plik
WORKDIR /opt/plik
COPY --from=build-env --chown=plik /go/src/github.com/root-gg/plik/server/public /opt/plik/public
COPY --from=build-env --chown=plik /go/src/github.com/root-gg/plik/server/plikd /opt/plik/server/plikd
COPY --from=build-env --chown=plik /go/src/github.com/root-gg/plik/server/plikd.cfg /opt/plik/plikd.cfg
EXPOSE 8080
CMD ["/opt/plik/server/plikd"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment