2019-01-15 07:41:03 +01:00
|
|
|
FROM golang:alpine3.8 AS build
|
|
|
|
|
|
|
|
COPY . /go/src/github.com/andreimarcu/linx-server
|
|
|
|
WORKDIR /go/src/github.com/andreimarcu/linx-server
|
2016-09-16 07:26:35 +02:00
|
|
|
|
|
|
|
RUN set -ex \
|
2017-05-02 06:49:27 +02:00
|
|
|
&& apk add --no-cache --virtual .build-deps git \
|
2019-01-15 07:41:03 +01:00
|
|
|
&& go get -v . \
|
2016-09-16 07:26:35 +02:00
|
|
|
&& apk del .build-deps
|
|
|
|
|
2019-01-15 07:41:03 +01:00
|
|
|
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/
|
|
|
|
|
2018-04-21 18:01:25 +02:00
|
|
|
RUN mkdir -p /data/files && mkdir -p /data/meta && chown -R 65534:65534 /data
|
|
|
|
|
2016-09-16 07:26:35 +02:00
|
|
|
VOLUME ["/data/files", "/data/meta"]
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
USER nobody
|
2019-01-15 07:41:03 +01:00
|
|
|
ENTRYPOINT ["/usr/local/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"]
|
2016-09-16 07:26:35 +02:00
|
|
|
CMD ["-sitename=linx", "-allowhotlink"]
|