-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
22 lines (18 loc) · 778 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM golang:1.19 AS builder
WORKDIR /src/
COPY . .
RUN go mod tidy &&\
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -a -o bin/http cmd/api/http/main.go &&\
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -a -o bin/grpc cmd/api/grpc/main.go &&\
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -a -o bin/redis-ce cmd/elasticsearch-indexer-redis/main.go
FROM debian:buster-slim AS api-http
WORKDIR /api/
COPY --from=builder ["/src/bin/http", "/src/wait-for-it.sh", "/api/"]
RUN chmod +x /api/wait-for-it.sh
FROM debian:buster-slim AS api-grpc
WORKDIR /api/
COPY --from=builder ["/src/bin/grpc", "/src/wait-for-it.sh", "/api/"]
RUN chmod +x /api/wait-for-it.sh
FROM debian:buster-slim AS redis-pubsub
WORKDIR /app/
COPY --from=builder ["/src/bin/redis-ce", "/app/"]