Main Upload
This is the start upload I figured this is a way for me to easily tweak with radio DJ and get the album art
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# ---- Dependencies (better-sqlite3 uses prebuilt binaries on linux-x64 glibc) ----
|
||||
FROM node:20-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
# Use `npm ci` when a lockfile is present, otherwise fall back to `npm install`.
|
||||
RUN if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi
|
||||
|
||||
# ---- Runtime ----
|
||||
FROM node:20-slim
|
||||
ENV NODE_ENV=production \
|
||||
PORT=3000 \
|
||||
DATA_DIR=/app/data
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package.json ./
|
||||
COPY server.js ./
|
||||
COPY public ./public
|
||||
|
||||
# Persistent SQLite storage lives in /app/data (map a volume or ./data here).
|
||||
RUN mkdir -p /app/data && chown -R node:node /app
|
||||
USER node
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user