-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (24 loc) · 866 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
36
# Use a lightweight Linux distribution as the base image
FROM golang:1.21-alpine AS builder
# Set the working directory inside the container
WORKDIR /build
# Copy the Go module files
COPY go.mod go.sum ./
# Download the Go module dependencies
RUN go mod download
# Copy the entire application source
COPY . .
# Build the Go application
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o iac-signalrsrv-linux
# Final stage
FROM alpine:latest
WORKDIR /app
COPY --from=builder /build/iac-signalrsrv-linux /app/iac-signalrsrv-linux
COPY --from=builder /build/dockersignalrconfig.json /app/signalrconfig.json
COPY --from=builder /build/public /app/public
# Set permissions on the application (if needed)
RUN chmod +x iac-signalrsrv-linux
# Expose additional ports
EXPOSE 8222
# Define an entry point to run the application
CMD ["./iac-signalrsrv-linux"]