mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 01:19:29 +02:00
Podman support + docs
This commit is contained in:
parent
c088b08e77
commit
12f408dc0a
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# .dockerignore
|
||||||
|
node_modules
|
||||||
|
*.log
|
||||||
|
*.md
|
||||||
|
.gitignore
|
||||||
|
Dockerfile
|
||||||
|
.env
|
48
Dockerfile
48
Dockerfile
@ -4,50 +4,44 @@ ARG OS=alpine
|
|||||||
|
|
||||||
FROM node:${NODE_VERSION}-${OS}
|
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
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
|
|
||||||
# Install git (already present, but ensure it’s available)
|
# Install git (for potential runtime needs)
|
||||||
RUN apk add --no-cache git
|
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
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Enable and prepare pnpm
|
# Enable and prepare pnpm
|
||||||
RUN corepack enable && corepack prepare pnpm@10 --activate
|
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 . .
|
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
|
RUN chown -R appuser:appgroup /app
|
||||||
|
|
||||||
# Switch to non-root user
|
# Switch to non-root user
|
||||||
USER appuser
|
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
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
|
|
||||||
# Start the app
|
# Start the app in development mode
|
||||||
CMD ["pnpm", "start:podman", "--", "--host", "--port", "$PORT"]
|
CMD ["pnpm", "run", "start:podman"]
|
6
docs/podman.md
Normal file
6
docs/podman.md
Normal 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/`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user