-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.dev
More file actions
72 lines (56 loc) · 2.26 KB
/
Copy pathDockerfile.dev
File metadata and controls
72 lines (56 loc) · 2.26 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# syntax=docker/dockerfile:1
FROM golang:1.26 AS builder
WORKDIR /app
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/api-server ./cmd/api-server
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/task-worker ./cmd/task-worker
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/task-scheduler ./cmd/task-scheduler
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/task-cli ./cmd/task-cli
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/tenant-manager ./cmd/tenant-manager
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/tenant-manager-cli ./cmd/tenant-manager-cli
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/event-reconciler ./cmd/event-reconciler
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 \
go build -o /bin/db-migrator ./cmd/db-migrator
FROM gcr.io/distroless/static-debian12:debug AS runner
COPY migrations /etc/cmk/migrations
COPY --from=builder /bin/api-server /bin/api-server
COPY --from=builder /bin/task-worker /bin/task-worker
COPY --from=builder /bin/task-scheduler /bin/task-scheduler
COPY --from=builder /bin/task-cli /bin/task-cli
COPY --from=builder /bin/tenant-manager /bin/tenant-manager
COPY --from=builder /bin/tenant-manager-cli /bin/tenant-manager-cli
COPY --from=builder /bin/db-migrator /bin/db-migrator
COPY --from=builder /bin/event-reconciler /bin/event-reconciler
EXPOSE 8080
ENTRYPOINT ["/bin/api-server"]