aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: fc5eda0594cc19f3c551757e5742b2e361681023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:1.15-alpine AS build

WORKDIR /shoelaces
COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-s -w -extldflags "-static"' -o /tmp/shoelaces . && \
printf "---\nnetworkMaps:\n" > /tmp/mappings.yaml

# Final container has basically nothing in it but the executable
FROM scratch
COPY --from=build /tmp/shoelaces /shoelaces

WORKDIR /data
COPY --from=build /tmp/mappings.yaml mappings.yaml
COPY --from=build /shoelaces/web /web

ENV BIND_ADDR=0.0.0.0:8081
EXPOSE 8081

ENTRYPOINT ["/shoelaces", "-data-dir", "/data", "-static-dir", "/web"]
CMD []
nihil fit ex nihilo