aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 2debe41fdbc805738cf7bcf62a3bf47b5c9b1634 (plain) (blame)
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
FROM golang:alpine AS builder

ENV CGO_ENABLED 0

COPY . /build
WORKDIR /build
RUN go build -o rest-server ./cmd/rest-server




FROM alpine

ENV DATA_DIRECTORY /data
ENV PASSWORD_FILE /data/.htpasswd

RUN apk add --no-cache --update apache2-utils

COPY docker/create_user /usr/bin/
COPY docker/delete_user /usr/bin/
COPY docker/entrypoint.sh /entrypoint.sh
COPY --from=builder /build/rest-server /usr/bin

VOLUME /data
EXPOSE 8000

CMD [ "/entrypoint.sh" ]