Add Go WireGuard panel with PostgreSQL 17 and Dokploy compose.

This commit is contained in:
2026-07-29 09:15:00 +03:00
parent 370e2455d4
commit 31ce2af622
25 changed files with 2423 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
FROM golang:1.26-alpine AS builder
WORKDIR /src
RUN apk add --no-cache git ca-certificates
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /out/wg-panel ./cmd/server
FROM alpine:3.21
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata curl
COPY --from=builder /out/wg-panel /app/wg-panel
COPY migrations /app/migrations
COPY web /app/web
COPY wg.sql /data/wg.sql
ENV APP_ROOT=/app \
MIGRATIONS_DIR=/app/migrations \
TEMPLATES_DIR=/app/web/templates \
STATIC_DIR=/app/web/static \
MYSQL_DUMP_PATH=/data/wg.sql \
APP_PORT=8080
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \
CMD curl -fsS http://127.0.0.1:8080/login >/dev/null || exit 1
USER nobody
CMD ["/app/wg-panel"]