-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (20 loc) · 758 Bytes
/
Dockerfile
File metadata and controls
32 lines (20 loc) · 758 Bytes
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
FROM openapitools/openapi-generator-cli:v5.0.0-beta3 AS generate
WORKDIR /go/src
copy . .
RUN docker-entrypoint.sh generate -i api/notification-service.yaml -g go-server -o ./ -p sourceFolder=internal/server -p packageName=server --git-user-id=commitdev --git-repo-id=zero-notification-service
FROM golang:1.18 AS build
WORKDIR /go/src
COPY go.mod .
COPY go.sum .
## fetch dependencies
RUN go mod tidy && go mod download
## copy project files
COPY . .
COPY --from=generate /go/src/ ./
RUN go install golang.org/x/tools/cmd/goimports@latest && goimports -w internal/server/
ENV CGO_ENABLED=0
RUN make build
FROM alpine:3.13 AS runtime
COPY --from=build /go/src/zero-notification-service ./
EXPOSE 80/tcp
ENTRYPOINT ["./zero-notification-service"]