This commit is contained in:
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
||||
# -------- Dockerfile (Multi-Stage Build) --------
|
||||
# 1. Builder-Stage
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.* ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/vfdashboard
|
||||
|
||||
# 2. Runtime-Stage
|
||||
FROM alpine:3.22
|
||||
|
||||
# HTTPS-Callouts in Alpine brauchen ca-certificates
|
||||
RUN apk add --no-cache ca-certificates
|
||||
RUN mkdir /data
|
||||
RUN mkdir /static
|
||||
#RUN mkdir /dynamicsrc
|
||||
#RUN mkdir /tempsrc
|
||||
COPY --from=builder /bin/vfdashboard /bin/vfdashboard
|
||||
COPY ./static /static
|
||||
# COPY ./static /tempsrc/static
|
||||
#COPY ./dynamicsrc /dynamicsrc
|
||||
|
||||
# Default listens on :8080 – siehe main.go
|
||||
EXPOSE 8080
|
||||
|
||||
# Environment defaults; können per compose überschrieben werden
|
||||
ENV HTTP_PORT=8080 \
|
||||
HTTP_TLS=false \
|
||||
HTTP_TLS_CERTIFICATE=./server-cert.pem \
|
||||
HTTP_TLS_PRIVATEKEY=./server-key.pem \
|
||||
DB_PATH=/data/guild_config.db
|
||||
|
||||
VOLUME /data
|
||||
|
||||
ENTRYPOINT ["/bin/vfdashboard"]
|
Reference in New Issue
Block a user