primeira versão do e-li-nps construido com IA
This commit is contained in:
commit
06950d6e2c
34 changed files with 2524 additions and 0 deletions
44
Dockerfile
Normal file
44
Dockerfile
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Build stage
|
||||
FROM golang:1.22-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Dependências do build
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
# Build do binário
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
|
||||
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:3.20
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Binário
|
||||
COPY --from=build /out/server /app/server
|
||||
|
||||
# Entry point (exige /app/.env montado via volume)
|
||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
RUN chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
# Assets/templates (o servidor lê do filesystem)
|
||||
COPY web/ /app/web/
|
||||
COPY README.md /app/README.md
|
||||
|
||||
# Variáveis default
|
||||
ENV ADDR=":8080"
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue