-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPublicRestAPIDockerfile
37 lines (21 loc) · 972 Bytes
/
PublicRestAPIDockerfile
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
# docker build -f PublicRestAPIDockerfile -t us-central1-docker.pkg.dev/totemic-fact-361111/go-services/rest_api:latest .
# docker push us-central1-docker.pkg.dev/totemic-fact-361111/go-services/rest_api:latest
# gcloud run deploy rest-api --image=us-central1-docker.pkg.dev/totemic-fact-361111/go-services/rest_api:latest --platform="managed" --region="us-central1" --project="totemic-fact-361111"
FROM golang:latest as build_base
ARG app_env
ENV APP_ENV $app_env
ENV CGO_ENABLED=0
ENV GET_FILE=root
COPY go_code/ /go/src/github.com/austincollinpena/google-ads-open-research/go_code
WORKDIR /go/src/github.com/austincollinpena/google-ads-open-research/go_code/cmd/public_rest_api
COPY go.mod ../../../
COPY go.sum ../../../
RUN go get
RUN go build -o /tmp/go_public_api
FROM alpine:latest
#ENV config=prod-env
ENV config=prod-env
ENV GET_FILE=root
COPY --from=build_base /tmp/go_public_api /app/go_public_api
EXPOSE 8080
ENTRYPOINT ["/app/go_public_api"]