23 lines
425 B
Docker
23 lines
425 B
Docker
# Use the official Golang image
|
|
FROM golang:1.23.1
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /app
|
|
|
|
# Copy go.mod and go.sum files and download dependencies
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy the rest of the application source code
|
|
COPY . .
|
|
|
|
RUN ls -la /app
|
|
|
|
# Expose the application's port (change if needed)
|
|
EXPOSE 5678
|
|
|
|
RUN go build -o main .
|
|
|
|
# Command to run the application
|
|
CMD ["./main"]
|