updated docker file for static files

This commit is contained in:
2026-03-02 00:47:45 -03:00
parent e505ddbdfc
commit 3cffa66144

View File

@@ -1,21 +1,13 @@
FROM golang:1.25-alpine AS builder
# Ensure CGO is off for a static binary
ENV CGO_ENABLED=0
# Ensure Go modules are strictly enforced
ENV GO111MODULE=on
WORKDIR /app
# Copy only the dependency files first
COPY go.mod go.sum ./
RUN go mod download
# Copy the entire project structure
COPY . .
# Build from the current directory (.) so it finds the module root
RUN go build -o /app/bot .
RUN CGO_ENABLED=0 GOOS=linux go build -o bot .
FROM alpine:latest
@@ -26,6 +18,7 @@ WORKDIR /root/
COPY --from=builder /app/bot .
COPY --from=builder /app/templates ./templates
COPY --from=builder /app/static ./static
COPY .env .
ENV DB_PATH=/data/bot.db