Add Unraid PUID and PGID support 3.0.1
Publish container / publish (push) Failing after 9s

This commit is contained in:
mfwadejr
2026-08-30 07:46:55 -04:00
committed by GitHub
parent 60c2af2fde
commit 0e87f5a26a
5 changed files with 20 additions and 6 deletions
+6 -3
View File
@@ -4,10 +4,13 @@ LABEL org.opencontainers.image.description="Self-contained vSeeBox inventory and
WORKDIR /app WORKDIR /app
COPY package.json server.mjs ./ COPY package.json server.mjs ./
COPY public ./public COPY public ./public
RUN mkdir -p /data && chown -R node:node /app /data COPY vboxstock-entrypoint.sh /usr/local/bin/vboxstock-entrypoint
ENV PORT=3000 DATA_DIR=/data NODE_ENV=production RUN apk add --no-cache su-exec \
USER node && chmod +x /usr/local/bin/vboxstock-entrypoint \
&& mkdir -p /data
ENV PORT=3000 DATA_DIR=/data NODE_ENV=production PUID=99 PGID=100
EXPOSE 3000 EXPOSE 3000
VOLUME ["/data"] VOLUME ["/data"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1:3000/api/health || exit 1 HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1:3000/api/health || exit 1
ENTRYPOINT ["/usr/local/bin/vboxstock-entrypoint"]
CMD ["node", "server.mjs"] CMD ["node", "server.mjs"]
+9 -2
View File
@@ -76,13 +76,15 @@ docker run -d \
--restart unless-stopped \ --restart unless-stopped \
-p 3000:3000 \ -p 3000:3000 \
-e TZ=America/New_York \ -e TZ=America/New_York \
-e PUID=99 \
-e PGID=100 \
-v /your/persistent/path:/data \ -v /your/persistent/path:/data \
ghcr.io/mfwadejr/vboxstock:latest ghcr.io/mfwadejr/vboxstock:latest
``` ```
Open `http://YOUR-SERVER-IP:3000`, sign in with the initial credentials above, and change the password when prompted. Open `http://YOUR-SERVER-IP:3000`, sign in with the initial credentials above, and change the password when prompted.
The host path mounted at `/data` is essential. Removing the container is safe when this mount remains intact; running without a persistent mount means the database can be lost when the container is replaced. The host path mounted at `/data` is essential. Removing the container is safe when this mount remains intact; running without a persistent mount means the database can be lost when the container is replaced. `PUID` and `PGID` determine which host user and group own the mounted data. The defaults are Unraid's `nobody:users` IDs, `99:100`.
## Docker Compose ## Docker Compose
@@ -110,8 +112,10 @@ Use the included `vboxstock-unraid.xml` template or create a container with thes
| Container data path | `/data` | | Container data path | `/data` |
| Suggested Unraid host path | `/mnt/user/appdata/vboxstock` | | Suggested Unraid host path | `/mnt/user/appdata/vboxstock` |
| Network mode | `bridge` | | Network mode | `bridge` |
| PUID | `99` |
| PGID | `100` |
Open the container's WebUI after installation. Updates can be applied with **Force Update** or through the CA Auto Update Applications plugin. Open the container's WebUI after installation. Updates can be applied with **Force Update** or through the CA Auto Update Applications plugin. At startup, the container creates `/data/backups`, applies the configured `PUID` and `PGID` ownership to `/data`, and then runs the application with those IDs.
## Data and backups ## Data and backups
@@ -120,6 +124,8 @@ vBoxStock uses SQLite and does not require MySQL, PostgreSQL, Redis, or another
- `/data/vboxstock.db` — active application database - `/data/vboxstock.db` — active application database
- `/data/backups/` — locally retained database snapshots - `/data/backups/` — locally retained database snapshots
`/data` is the path inside the container. When `/mnt/user/appdata/vboxstock` is mapped directly to `/data`, the Unraid host folder contains `vboxstock.db` and `backups/`; it does not contain another nested folder named `data`.
The Admin page can create a transactionally consistent snapshot, download it to another device, restore a local snapshot, or upload and restore a downloaded copy. A pre-restore snapshot is created automatically before the active database is replaced. The Admin page can create a transactionally consistent snapshot, download it to another device, restore a local snapshot, or upload and restore a downloaded copy. A pre-restore snapshot is created automatically before the active database is replaced.
Backups contain customer information and password hashes. Store downloaded copies securely. Restoring a database also restores the user accounts contained in that backup and signs out every active session. An older backup without user accounts starts the first-login `admin` / `admin` setup flow. Backups contain customer information and password hashes. Store downloaded copies securely. Restoring a database also restores the user accounts contained in that backup and signs out every active session. An older backup without user accounts starts the first-login `admin` / `admin` setup flow.
@@ -143,6 +149,7 @@ docker exec -e RESET_ADMIN_PASSWORD=NewPassword123 -it vboxstock node server.mjs
- Image: `ghcr.io/mfwadejr/vboxstock:latest` - Image: `ghcr.io/mfwadejr/vboxstock:latest`
- Application port: `3000/tcp` - Application port: `3000/tcp`
- Persistent volume: `/data` - Persistent volume: `/data`
- Runtime ownership: configurable with `PUID` and `PGID` (`99:100` by default)
- Health check: `GET /api/health` - Health check: `GET /api/health`
- Runtime: Node.js 22 - Runtime: Node.js 22
- Database: SQLite - Database: SQLite
+2
View File
@@ -9,3 +9,5 @@ services:
- ./data:/data - ./data:/data
environment: environment:
- TZ=America/New_York - TZ=America/New_York
- PUID=99
- PGID=100
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vboxstock", "name": "vboxstock",
"version": "3.0.0", "version": "3.0.1",
"private": true, "private": true,
"type": "module", "type": "module",
"engines": { "node": ">=22.13.0" }, "engines": { "node": ">=22.13.0" },
+2
View File
@@ -6,5 +6,7 @@
<Category>Tools:</Category><WebUI>http://[IP]:[PORT:3000]/</WebUI><TemplateURL></TemplateURL><Icon></Icon> <Category>Tools:</Category><WebUI>http://[IP]:[PORT:3000]/</WebUI><TemplateURL></TemplateURL><Icon></Icon>
<Config Name="Web UI Port" Target="3000" Default="3000" Mode="tcp" Description="vBoxStock web interface" Type="Port" Display="always" Required="true" Mask="false">3000</Config> <Config Name="Web UI Port" Target="3000" Default="3000" Mode="tcp" Description="vBoxStock web interface" Type="Port" Display="always" Required="true" Mask="false">3000</Config>
<Config Name="App Data" Target="/data" Default="/mnt/user/appdata/vboxstock" Mode="rw" Description="SQLite database and durable application data" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/vboxstock</Config> <Config Name="App Data" Target="/data" Default="/mnt/user/appdata/vboxstock" Mode="rw" Description="SQLite database and durable application data" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/vboxstock</Config>
<Config Name="User ID" Target="PUID" Default="99" Mode="" Description="Host user ID used to own and write application data. Unraid default is 99 (nobody)." Type="Variable" Display="advanced" Required="true" Mask="false">99</Config>
<Config Name="Group ID" Target="PGID" Default="100" Mode="" Description="Host group ID used to own and write application data. Unraid default is 100 (users)." Type="Variable" Display="advanced" Required="true" Mask="false">100</Config>
<Config Name="Timezone" Target="TZ" Default="America/New_York" Mode="" Description="Container timezone" Type="Variable" Display="advanced" Required="false" Mask="false">America/New_York</Config> <Config Name="Timezone" Target="TZ" Default="America/New_York" Mode="" Description="Container timezone" Type="Variable" Display="advanced" Required="false" Mask="false">America/New_York</Config>
</Container> </Container>