from dockerfile to containerfile

This commit is contained in:
Cipher Vance
2025-11-15 13:50:46 -06:00
parent 84e4919e59
commit 51b1b9b2ac

29
Containerfile Normal file
View File

@@ -0,0 +1,29 @@
# Stage 1: Build
FROM docker.io/library/golang:1.23-alpine AS builder
WORKDIR /build
RUN apk add --no-cache gcc musl-dev
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo \
-o admin-panel ./cmd/admin-panel
# Stage 2: Runtime
FROM docker.io/library/alpine:latest
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=builder /build/admin-panel .
COPY .env .env
COPY web ./web
EXPOSE 5001
CMD ["./admin-panel"]