Files
TGSS/Dockerfile
T
mahdium bc2b38a3b0 feat: add Docker support and CI workflow
- Created a Dockerfile to build and deploy the application using a multi-stage build process.
- Added a GitHub Actions workflow to automatically build and publish the Docker image to GitHub Container Registry on pushes to the main branch.
- Updated go.mod and go.sum to reflect dependency upgrades and changes.
- Modified the RSS generator to extend the photo expiration time from 10 minutes to 12 hours.
- Updated rate limiter configuration to allow for environment variable customization.
2026-05-08 13:54:04 +03:30

31 lines
594 B
Docker
Executable File

# https://docs.docker.com/guides/golang/build-images/
# syntax=docker/dockerfile:1
# Build the application from source
FROM golang:1.26.3-trixie AS build-stage
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY cmd /app/cmd/
COPY internal /app/internal/
RUN GOOS=linux go build -ldflags="-s -w" -tags=release -o /TGSS ./cmd/server/main.go
# Deploy the application binary into a lean image
# TODO: Move to alpine
FROM gcr.io/distroless/base-debian13 AS build-release-stage
WORKDIR /
COPY --from=build-stage /TGSS /TGSS
EXPOSE 3000
ENV GIN_MODE=release
ENTRYPOINT ["/TGSS"]