mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-24 00:09:31 +02:00
Merge d49313cbd0
into 46c78a0540
This commit is contained in:
commit
3392053104
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# .dockerignore
|
||||||
|
node_modules
|
||||||
|
*.log
|
||||||
|
*.md
|
||||||
|
.gitignore
|
||||||
|
Dockerfile
|
||||||
|
.env
|
2
.github/workflows/deploy-beta.yml
vendored
2
.github/workflows/deploy-beta.yml
vendored
@ -21,8 +21,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -19,8 +19,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
2
.github/workflows/github-pages.yml
vendored
2
.github/workflows/github-pages.yml
vendored
@ -37,8 +37,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Setup Node 22.14.1
|
- name: Setup Node 22.14.1
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
2
.github/workflows/linting.yml
vendored
2
.github/workflows/linting.yml
vendored
@ -25,8 +25,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
2
.github/workflows/test-shard-template.yml
vendored
2
.github/workflows/test-shard-template.yml
vendored
@ -31,8 +31,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
47
Dockerfile
Normal file
47
Dockerfile
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
ARG NODE_VERSION=22.14
|
||||||
|
ARG OS=alpine
|
||||||
|
|
||||||
|
FROM node:${NODE_VERSION}-${OS}
|
||||||
|
|
||||||
|
# Create non-root user
|
||||||
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
|
|
||||||
|
# Install git (for potential runtime needs)
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Enable and prepare pnpm
|
||||||
|
RUN corepack enable && corepack prepare pnpm@10.14.0 --activate
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
|
# Install all dependencies
|
||||||
|
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 in development mode
|
||||||
|
CMD ["pnpm", "run", "start:podman"]
|
27
docs/podman.md
Normal file
27
docs/podman.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Using Podman
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* `podman >=5.x`
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. `podman build -t pokerogue -f Dockerfile .`
|
||||||
|
2. `podman create --name temp-pokerogue localhost/pokerogue`
|
||||||
|
3. `podman cp temp-pokerogue:/app/node_modules ./`
|
||||||
|
4. `podman cp temp-pokerogue:/app/public/locales ./public/`
|
||||||
|
5. `podman rm temp-pokerogue`
|
||||||
|
6. `podman run --rm -p 8000:8000 -v $(pwd):/app:Z --userns=keep-id -u $(id -u):$(id -g) localhost/pokerogue`
|
||||||
|
7. Visit `http://localhost:8000/`
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|
||||||
|
1. Steps 2,3,4 are required because mounting working directory without installed `node_modules/` locally will be empty,
|
||||||
|
this way we prevent it by copying them from the container itself to local directory
|
||||||
|
|
||||||
|
2. `podman run` may take a couple of minutes to mount the working directory
|
||||||
|
|
||||||
|
### Running tests inside container
|
||||||
|
|
||||||
|
1. `podman run --rm -p 8000:8000 -v $(pwd):/app:Z --userns=keep-id -u $(id -u):$(id -g) localhost/pokerogue2 pnpm test:silent
|
||||||
|
`
|
@ -6,6 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
"start:dev": "vite --mode development",
|
"start:dev": "vite --mode development",
|
||||||
|
"start:podman": "vite --mode development --host 0.0.0.0 --port $PORT",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"build:beta": "vite build --mode beta",
|
"build:beta": "vite build --mode beta",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
@ -63,5 +64,6 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.0.0"
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.14.0"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user