-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 742 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 742 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
30
31
32
33
34
FROM golang:alpine
# Set necessary environment variables needed for the image
ENV GO111MODULE=on \
GCO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
# Move to working directory /build
WORKDIR /build
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the code into the container
ADD api ./api
ADD cmd ./cmd
ADD internal ./internal
# Build the application
RUN go build -o bootstrap-echo-openapi-docker cmd/api/main.go
# Move to /app directory as the place for resulting binary folder
WORKDIR /app
# Copy binary from build to main folder
RUN cp /build/bootstrap-echo-openapi-docker .
EXPOSE 8112
# Command to run when starting the container
CMD ["/app/bootstrap-echo-openapi-docker"]