Private
Public Access
1
0

Init
Some checks failed
Build & Deploy Game / build-and-deploy (push) Failing after 6s

This commit is contained in:
Sebastian Unterschütz
2025-11-24 22:32:10 +01:00
commit 6fa7e0a7c7
20 changed files with 2355 additions and 0 deletions

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
# --- STAGE 1: Builder (Kompilieren) ---
FROM golang:1.23-alpine AS builder
# Arbeitsverzeichnis im Container erstellen
WORKDIR /app
# Abhängigkeiten kopieren und herunterladen (Caching-Effizienz)
COPY go.mod go.sum ./
RUN go mod download
# Den gesamten Rest des Codes kopieren
COPY . .
# Das Go-Programm kompilieren
# -o server: Nenne die Datei "server"
RUN go build -o server main.go
# --- STAGE 2: Runner (Ausführen) ---
FROM alpine:latest
WORKDIR /root/
# Wir brauchen evtl. Zertifikate für HTTPS (falls du später externe APIs nutzt)
RUN apk --no-cache add ca-certificates
# Kopiere das fertige Programm aus Stage 1
COPY --from=builder /app/server .
# WICHTIG: Kopiere die statischen Ordner (HTML, CSS, Bilder, Fonts, Admin)
COPY --from=builder /app/static ./static
COPY --from=builder /app/secure ./secure
# Port freigeben
EXPOSE 8080
# Startbefehl
CMD ["./server"]