-
Notifications
You must be signed in to change notification settings - Fork 25
/
Containerfile
36 lines (26 loc) · 936 Bytes
/
Containerfile
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
35
36
FROM registry.access.redhat.com/ubi9/go-toolset as builder
WORKDIR /go/src/app
COPY api api
COPY cmd cmd
COPY internal internal
COPY tools tools
COPY go.mod go.mod
COPY go.sum go.sum
USER 0
RUN go get -d ./... && \
go build -o pt-api cmd/payload-tracker-api/main.go && \
go build -o pt-consumer cmd/payload-tracker-consumer/main.go && \
go build -o pt-migration internal/migration/main.go && \
go build -o pt-seeder tools/db-seeder/main.go
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
USER 0
WORKDIR /
COPY --from=builder /go/src/app/pt-api ./pt-api
COPY --from=builder /go/src/app/pt-consumer ./pt-consumer
COPY --from=builder /go/src/app/pt-migration ./pt-migration
COPY --from=builder /go/src/app/pt-seeder ./pt-seeder
COPY tools ./tools
USER 1001
# There is no command here becuase this image can be used for
# both the api and consumer. The command to run should be in the
# deployment config.