Podman support + docs

This commit is contained in:
Domagoj 2025-07-29 17:39:12 +02:00
parent c088b08e77
commit 12f408dc0a
3 changed files with 34 additions and 27 deletions

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
# .dockerignore
node_modules
*.log
*.md
.gitignore
Dockerfile
.env

View File

@ -4,50 +4,44 @@ ARG OS=alpine
FROM node:${NODE_VERSION}-${OS}
# Create non-root user for rootless operation
# Create non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Install git (already present, but ensure its available)
# Install git (for potential runtime needs)
RUN apk add --no-cache git
# Set environment variables
ENV VITE_BYPASS_LOGIN=1 \
VITE_BYPASS_TUTORIAL=0 \
NEXT_TELEMETRY_DISABLED=1 \
PNP_HOME=/home/appuser/.shrc \
NODE_ENV=production \
PORT=8000
# Set working directory
WORKDIR /app
# Enable and prepare pnpm
RUN corepack enable && corepack prepare pnpm@10 --activate
# Copy package files first for caching
COPY package.json pnpm-lock.yaml ./
# Initialize Git repository and copy .git (for submodules and lefthook)
COPY .git ./.git
COPY .gitmodules ./.gitmodules
# Install dependencies and initialize submodules
RUN --mount=type=cache,target=/home/appuser/.pnpm-store \
git config --global --add safe.directory /app && \
git submodule update --init --recursive && \
pnpm install --frozen-lockfile
# Copy remaining files
COPY . .
# Change ownership for rootless compatibility
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install all dependencies, skipping postinstall
RUN --mount=type=cache,target=/home/appuser/.pnpm-store \
pnpm install --frozen-lockfile && \
rm -rf /home/appuser/.pnpm-store/*
# Change ownership
RUN chown -R appuser:appgroup /app
# Switch to non-root user
USER appuser
# Set environment variables
ENV VITE_BYPASS_LOGIN=1 \
VITE_BYPASS_TUTORIAL=0 \
NEXT_TELEMETRY_DISABLED=1 \
PNP_HOME=/home/appuser/.shrc \
NODE_ENV=development \
PORT=8000
# Expose port
EXPOSE $PORT
# Start the app
CMD ["pnpm", "start:podman", "--", "--host", "--port", "$PORT"]
# Start the app in development mode
CMD ["pnpm", "run", "start:podman"]

6
docs/podman.md Normal file
View File

@ -0,0 +1,6 @@
# Using with Podman
1. `podman build -t pokerogue:1.0 -f Dockerfile .`
2. `podman run --rm -p 8000:8000 localhost/pokerogue:1.0`
3. Visit `http://localhost:8000/`