Files
Inventory-Manager-CC/web/server/Dockerfile
MayaTheShy 173a0a9f95 Persist config files across Opus package updates
The Opus package manager deletes the entire package directory on
update (fs.delete(packageDir)) before re-downloading files. This
wiped all config files (.manager_config, .client_config, etc.) that
were stored inside packages/inventory-manager/.

Fix: add _configPath() helper to every program that resolves config
file paths to usr/config/inventory-manager/ when running under Opus,
which lives outside the package directory and survives updates.
Falls back to the local _path() for standalone (non-Opus) use.

Updated files:
- inventoryManager.lua, manager/config.lua, inventoryClient.lua,
  inventoryWebBridge.lua, dropperController.lua, craftingTurtle.lua
- .package install script: saves configs to usr/config/inventory-manager/
- autorun/startup.lua: checks both persistent and package dirs
- startup/client.lua: uses persistent dir for .client_setup/.dropper_config
- web/server/Dockerfile: switch health check to wget (from prior fix)
2026-03-22 20:51:31 -04:00

34 lines
791 B
Docker

# Node.js backend
FROM node:18-alpine
# Build tools needed for better-sqlite3 native compilation
# su-exec for dropping privileges in entrypoint
RUN apk add --no-cache python3 make g++ su-exec
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
# Remove build tools after install to keep image small
RUN apk del python3 make g++
COPY . .
# Create data directory for SQLite
RUN mkdir -p /data
VOLUME /data
# Entrypoint fixes /data permissions then drops to node user
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 3001
HEALTHCHECK --interval=10s --timeout=5s --start-period=15s --retries=3 \
CMD wget --spider -q http://localhost:3001/api/health || exit 1
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "server.js"]