dockerized

This commit is contained in:
Juraj Kubričan
2024-09-06 21:49:04 +02:00
parent 80d26daaf6
commit bde60f016d
9 changed files with 194 additions and 48 deletions

24
dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Step 1: Build the Go binary
FROM golang:bookworm AS build
# Set the current working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files
COPY go.mod go.sum ./
# Download all Go dependencies
RUN go mod download
# Copy the rest of the application code
COPY . .
# Build the Go application
RUN go build -o main src/main.go
# Command to run the executable
RUN chmod a+x main
CMD ["./main"]
# Expose the port on which the Go server will run
EXPOSE 80