generated from wisdom-oss/microservice-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (18 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
24 lines (18 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM --platform=$BUILDPLATFORM docker.io/golang:alpine AS build-service
ARG TARGETOS TARGETARCH
ENV GOMODCACHE=/root/.cache/go-build
WORKDIR /src
COPY --link go.* .
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
COPY --link . .
RUN --mount=type=cache,target=/root/.cache/go-build GOOS=$TARGETOS GOARCH=$TARGETARCH go build -tags=release,nomsgpack,go_json -ldflags="-s -w" -o /service .
FROM scratch
LABEL traefik.enable=true
LABEL traefik.http.routers.template-service.middlewares=brain-tank-service
LABEL traefik.http.routers.template-service.rule="PathPrefix(`/api/brain-tank`)"
LABEL traefik.http.middlewares.template-service.stripprefix.prefixes="/api/brain-tank"
ENV GIN_MODE=release
COPY --from=build-service /etc/ssl/cert.pem /etc/ssl/cert.pem
COPY --from=build-service /service /service
ENTRYPOINT ["/service"]
EXPOSE 8000