Added Docker workflow
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 6m23s

This commit is contained in:
2026-03-09 21:17:00 +01:00
parent e2726083f6
commit 17c766c27f
4 changed files with 186 additions and 0 deletions

47
Dockerfile Normal file
View File

@@ -0,0 +1,47 @@
# ─── Stage 1: Install dependencies ───────────────────────────────────────────
FROM oven/bun:1 AS deps
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# ─── Stage 2: Build Next.js ──────────────────────────────────────────────────
FROM oven/bun:1 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build
# ─── Stage 3: Production runner ──────────────────────────────────────────────
FROM oven/bun:1-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy runtime dependencies
COPY --from=builder /app/node_modules ./node_modules
# Copy Next.js build output
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
# Copy server entry point and all runtime source files
COPY --from=builder /app/server.ts ./server.ts
COPY --from=builder /app/lib ./lib
COPY --from=builder /app/drizzle ./drizzle
COPY --from=builder /app/tsconfig.json ./tsconfig.json
COPY --from=builder /app/next.config.ts ./next.config.ts
# Pre-create data directory (SQLite db + uploads land here)
RUN mkdir -p /app/data
EXPOSE 3000
# Volumes for persistent data
# Mount your Minecraft server directory to /mc-server
# Mount your backups directory to /backups
VOLUME ["/app/data", "/mc-server", "/backups"]
CMD ["bun", "--bun", "run", "server.ts"]