forked from nitram509/lib-bpmn-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 808 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 with the official Go image to build the binary
FROM golang:alpine AS builder
# Install gcc and g++ for building C/C++ dependencies
RUN apk add --no-cache gcc g++
# Set the Current Working Directory inside the container
WORKDIR /app
# Copy the go.mod and go.sum files
COPY go.mod go.sum ./
# Download the dependencies
RUN go mod download
# Copy the source code into the container
COPY . .
# Build the Go app
RUN go build -o go-bpms-bin cmd/main.go
# Start a new stage from scratch
FROM alpine:latest
# Set the Current Working Directory inside the container
WORKDIR /root/
# Copy the Pre-built binary file from the previous stage
COPY --from=builder /app/go-bpms-bin .
# Expose port 8080 and 4001 to the outside world
EXPOSE 8080 4001
# Command to run the executable
CMD ["./go-bpms-bin"]