This repository has been archived on 2026-01-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cover-letter-templater/Dockerfile.backend
2025-07-05 21:22:18 +03:00

35 lines
623 B
Docker

FROM golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a AS base
# Set up workdir
WORKDIR /app
# Install dependencies
COPY go.mod go.sum ./
RUN go mod download
# ---- Production mode ----
FROM base AS prod
# Copy code, and compile
COPY . .
RUN go build -o server main.go
# Expose 8080 port
EXPOSE 8080
# Run server binary on start
CMD ["./server"]
# ---- Development mode ----
FROM base AS dev
# Install air for hot reloading
RUN go install github.com/air-verse/air@latest
# Copy code, and expose port
COPY . .
EXPOSE 8080
# Enable hot reloading for go
CMD [ "air" ]