Add new multi-stage slim Dockerfile (#154)
This commit is contained in:
parent
9d7f698c70
commit
5340f23f4d
17
Dockerfile
17
Dockerfile
|
@ -1,15 +1,26 @@
|
||||||
FROM golang:alpine
|
FROM golang:alpine3.8 AS build
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/andreimarcu/linx-server
|
||||||
|
WORKDIR /go/src/github.com/andreimarcu/linx-server
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --no-cache --virtual .build-deps git \
|
&& apk add --no-cache --virtual .build-deps git \
|
||||||
&& go get github.com/andreimarcu/linx-server \
|
&& go get -v . \
|
||||||
&& apk del .build-deps
|
&& apk del .build-deps
|
||||||
|
|
||||||
|
FROM alpine:3.8
|
||||||
|
|
||||||
|
COPY --from=build /go/bin/linx-server /usr/local/bin/linx-server
|
||||||
|
|
||||||
|
ENV GOPATH /go
|
||||||
|
COPY static /go/src/github.com/andreimarcu/linx-server/static/
|
||||||
|
COPY templates /go/src/github.com/andreimarcu/linx-server/templates/
|
||||||
|
|
||||||
RUN mkdir -p /data/files && mkdir -p /data/meta && chown -R 65534:65534 /data
|
RUN mkdir -p /data/files && mkdir -p /data/meta && chown -R 65534:65534 /data
|
||||||
|
|
||||||
VOLUME ["/data/files", "/data/meta"]
|
VOLUME ["/data/files", "/data/meta"]
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
USER nobody
|
USER nobody
|
||||||
ENTRYPOINT ["/go/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"]
|
ENTRYPOINT ["/usr/local/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"]
|
||||||
CMD ["-sitename=linx", "-allowhotlink"]
|
CMD ["-sitename=linx", "-allowhotlink"]
|
||||||
|
|
Loading…
Reference in New Issue