Files
Inventory-Manager-CC/web/server/Dockerfile
MayaTheShy 9f322003db Add SQLite persistence + official Minecraft item icons
Database (better-sqlite3):
- Persist items, furnaces, alerts, recipes, settings to SQLite
- Auto-restore last known state when server restarts or bridge disconnects
- Item count history tracking (5-min snapshots, 7-day retention)
- /api/history/:itemName endpoint for item count history
- Docker volume for database file persistence
- Graceful shutdown with DB connection cleanup

Icons:
- Replace mc-heads.net with official Minecraft game textures via CDN
- Cascading fallback: item texture -> block texture -> emoji
- In-memory URL cache to avoid redundant network requests
- Block texture suffix mapping (furnace_front, barrel_top, etc.)
- Crisp pixel-art rendering with image-rendering: pixelated
2026-03-21 18:10:44 -04:00

28 lines
625 B
Docker

# Node.js backend
FROM node:18-alpine
# Build tools needed for better-sqlite3 native compilation
RUN apk add --no-cache python3 make g++
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
EXPOSE 3001
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3001/api/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"
CMD ["node", "server.js"]