Dockerfile 801 Bytes
Newer Older
Christian Muehlhaeuser's avatar
Christian Muehlhaeuser committed
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
FROM golang:alpine AS builder

LABEL authors="Christian Muehlhaeuser: muesli@gmail.com"

# Install git & make
# Git is required for fetching the dependencies
RUN apk update && \
    apk add --no-cache git make ca-certificates && \
    update-ca-certificates

# Set the working directory for the container
WORKDIR /go/sangha

# Build the binary
COPY . .
RUN go build

FROM alpine

RUN apk update && \
    apk add --no-cache ca-certificates tzdata && \
    update-ca-certificates

COPY --from=builder /go/sangha/sangha /go/bin/sangha

# Expose the application port
EXPOSE 9980

# create a volume for the configuration persistence
VOLUME /conf

# This form of ENTRYPOINT allows the sangha process to catch signals from the `docker stop` command
ENTRYPOINT /go/bin/sangha --config /conf/sangha.conf serve