-
Notifications
You must be signed in to change notification settings - Fork 1
/
dockerfile.production
38 lines (27 loc) · 1.14 KB
/
dockerfile.production
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
# Use the official Golang image as the build environment.
FROM golang:1.19.5-alpine AS builder
# Set the working directory within the Docker image.
WORKDIR /temp
# Copy go.mod and go.sum to the /temp directory in the image.
COPY go.mod go.sum ./
# Download the dependencies listed in go.mod.
RUN go mod download
# Copy the rest of the application code to the /temp directory.
COPY . .
# Start a new build stage. This stage begins with a minimal Alpine Linux image.
FROM alpine:latest
# Upgrade all the software in the Alpine Linux image, then
# install the ca-certificates package. This package is necessary
# if your application makes HTTPS requests.
RUN apk --no-cache --update upgrade && \
apk --no-cache add ca-certificates
# Set the working directory to /app.
WORKDIR /app
COPY --from=builder /temp .
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# Expose port 8080. This is the port that your application will use.
EXPOSE 8080
# Specify the command to run when the Docker container starts.
ENTRYPOINT ["./mccs", "-config=production"]
# CMD is optional; it provides defaults for an executing container.
CMD []