about summary refs log tree commit diff stats
path: root/Dockerfile
blob: 2b5da4bbace445aa2dfc2a7dfeac258bdb83f4eb (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
28
29
30
31
32
33
34
# Build
FROM golang:alpine AS build

ENV CGO_ENABLED=0

RUN apk add --no-cache -U build-base git make

RUN mkdir -p /src

WORKDIR /src

# Copy Makefile
COPY Makefile ./

# Install deps
RUN make deps

# Copy content
COPY . .

# Build the site
RUN make build

# Runtime
FROM scratch

WORKDIR /
VOLUME /data

COPY --from=build /go/bin/static /static
COPY --from=build /src/.pub /data

ENTRYPOINT ["/static"]
CMD ["-r", "/data"]