add project

This commit is contained in:
2026-05-17 14:51:37 -04:00
parent 2f1a0d6020
commit fe8dc317b2
40 changed files with 6137 additions and 0 deletions

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
# ---- Build stage ----
FROM node:22-slim AS builder
WORKDIR /app
# Native module build tools (better-sqlite3, bcrypt)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ \
&& rm -rf /var/lib/apt/lists/*
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --production
# ---- Production stage ----
FROM node:22-slim AS runner
WORKDIR /app
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./
# Directories that will be bind-mounted at runtime
RUN mkdir -p /data /games/public /games/private
EXPOSE 3000
ENV NODE_ENV=production \
GAMES_PATH=/games \
DB_PATH=/data/game-grid.db
CMD ["node", "build/index.js"]