-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
42 lines (27 loc) · 897 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
31
32
33
34
35
36
37
38
39
40
41
42
FROM golang:1.22.2 AS oms-builder
WORKDIR /usr/src/oms
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download
COPY app ./app
COPY cmd ./cmd
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -v -o /usr/local/bin/oms ./cmd/oms
FROM scratch AS oms-worker
COPY --from=oms-builder /usr/local/bin/oms /usr/local/bin/oms
ENTRYPOINT ["/usr/local/bin/oms", "worker"]
FROM scratch as oms-api
EXPOSE 8081
EXPOSE 8082
EXPOSE 8083
EXPOSE 8084
VOLUME /data
ENV DATA_DIR=/data
COPY --from=oms-builder /usr/local/bin/oms /usr/local/bin/oms
ENTRYPOINT ["/usr/local/bin/oms", "api"]
FROM scratch as oms-codec-server
EXPOSE 8089
COPY --from=oms-builder /usr/local/bin/oms /usr/local/bin/oms
ENTRYPOINT ["/usr/local/bin/oms", "codec-server"]