-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (27 loc) · 1017 Bytes
/
Dockerfile
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
########################################################
# Build stage for dev and test #
########################################################
FROM docker.io/golang:1.22-alpine as dev-builder
WORKDIR /app
COPY cmd ./cmd
COPY domain ./domain
COPY ports ./ports
COPY usecase ./usecase
COPY adapters ./adapters
COPY go.mod .
COPY go.sum .
RUN go mod tidy
RUN go test ./domain/*.go -coverprofile=coverage-domain.out
RUN go test ./ports/*.go -coverprofile=coverage-ports.out
RUN go test ./usecase/*.go -coverprofile=coverage-usecase.out
RUN go build -o main ./cmd/main.go
########################################################
# Prod #
########################################################
FROM docker.io/alpine:3 as prod
USER 35000
WORKDIR /app
COPY --from=dev-builder /app/main .
ENTRYPOINT ["./main","-c","config","-i","yaml","-o","html"]
CMD ["config.yaml"]
# Keep in mind you would need to add your templates to the running container