-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (25 loc) · 888 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
# Start from golang:1.12-alpine base image
# builder
FROM golang:1.15-alpine as builder
# The latest alpine images don't have some tools like (`git` and `bash`).
# Adding git, bash and openssh to the image
RUN apk update && apk upgrade && \
apk --update --no-cache add bash
# Set the Current Working Directory inside the container
WORKDIR /service
# Copy the source from the current directory to the Working Directory inside the container
COPY . .
# Download all dependancies to vendor folder.
RUN go mod vendor
# Build the Go app
RUN go build -o firebase_notify_svc .
## Distribution
FROM alpine:latest
RUN apk update && apk upgrade && \
apk --no-cache --update add tzdata && \
mkdir /service
WORKDIR /service
COPY --from=builder /service/firebase_notify_svc /service
COPY --from=builder /service/.env /service
# Run the executable
CMD /service/firebase_notify_svc