-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 867 Bytes
/
Dockerfile
File metadata and controls
38 lines (30 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Dockerfile for gotify production
FROM golang:alpine3.21 AS buildStage
LABEL maintainer="digIT <digit@chalmers.it>"
# Install git
RUN apk update
RUN apk upgrade
RUN apk add --update git
# Copy sources
RUN mkdir -p $GOPATH/src/github.com/cthit/gotify
COPY . $GOPATH/src/github.com/cthit/gotify
WORKDIR $GOPATH/src/github.com/cthit/gotify/cmd
# Build binary
RUN go install -v
RUN mkdir /app && mv $GOPATH/bin/cmd /app/gotify
##########################
# PRODUCTION STAGE #
##########################
FROM alpine
LABEL maintainer="digIT <digit@chalmers.it>"
# Add standard certificates
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
# Set user
RUN addgroup -S app
RUN adduser -S -G app -s /bin/bash app
USER app:app
# Copy binary
COPY --from=buildStage /app/gotify /app/gotify
# Set good defaults
WORKDIR /app
ENTRYPOINT /app/gotify