This commit is contained in:
2026-01-13 01:38:15 -05:00
parent b67235b93d
commit d9db2a771d
10 changed files with 334 additions and 0 deletions

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Use the official Golang image as the base.
FROM golang:1.22-alpine AS base
# Install git (required by go modules) and any other utilities.
RUN apk add --no-cache git
# Set the working directory inside the container.
WORKDIR /app
# Cache go.mod and go.sum to speed up dependency installation.
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source code.
COPY . .
# Build the binary after copying the source files.
RUN go build -o /app/tmp/main ./cmd/app
# The container will start Air, which watches the source files and rebuilds the app on change.
CMD ["./tmp/main"]