-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 749 Bytes
/
Dockerfile
File metadata and controls
29 lines (19 loc) · 749 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
FROM golang:1.18-alpine as builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN mkdir build
RUN go build -o build/device-service ./device-service
RUN go build -o build/websocket-service ./websocket-service
RUN go build -o build/user-service ./user-service
RUN go build -o build/transaction-service ./transaction-service
FROM alpine as runtime
RUN apk add --no-cache bash
SHELL ["/bin/bash", "-c"]
# Copy executable binary file from the 'builder' image to this 'runtime' image
COPY --from=builder /app/build/device-service /app/
COPY --from=builder /app/build/websocket-service /app/
COPY --from=builder /app/build/user-service /app/
COPY --from=builder /app/build/transaction-service /app/