Skip to content

Commit

Permalink
Update Dockerfile's Go & Alpine versions
Browse files Browse the repository at this point in the history
Update Go to 1.22 and Alpine to 3.20 and change Dockerfile accordingly.

Add `go build` command.
Run chmod on /go/src/github.com/andreimarcu/linx-server to make static &
templates directories readable by the server (only needed when image is
built with UMASK=0027).
  • Loading branch information
teapot9 committed Sep 28, 2024
1 parent c8f7c32 commit fd18402
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM golang:1.14-alpine3.11 AS build
FROM golang:1.22-alpine3.20 AS build

COPY . /go/src/github.com/andreimarcu/linx-server
WORKDIR /go/src/github.com/andreimarcu/linx-server

RUN set -ex \
&& apk add --no-cache --virtual .build-deps git \
&& go get -v . \
&& go build -o /go/bin/linx-server . \
&& apk del .build-deps

FROM alpine:3.11
FROM alpine:3.20

COPY --from=build /go/bin/linx-server /usr/local/bin/linx-server

Expand All @@ -18,7 +19,9 @@ ENV SSL_CERT_FILE /etc/ssl/cert.pem
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 && mkdir -p /data/locks && chown -R 65534:65534 /data
RUN mkdir -p /data/files /data/meta /data/locks \
&& chown -R 65534:65534 /data \
&& chmod -R u=rwX,go=rX /go/src/github.com/andreimarcu/linx-server

VOLUME ["/data/files", "/data/meta", "/data/locks"]

Expand Down

0 comments on commit fd18402

Please sign in to comment.