19 lines
396 B
Docker
19 lines
396 B
Docker
# Use the official Golang image
|
|
FROM golang:1.21
|
|
|
|
# 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 . .
|
|
|
|
# Expose the application's port (change if needed)
|
|
EXPOSE 5678
|
|
|
|
# Command to run the application
|
|
CMD ["go", "run", "main.go"]
|