diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..83c09c7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +node_modules +server/dist +web/dist +data +.git +.gitignore +*.log +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9cd94a3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# ---- build stage: deps + compile + test ---- +FROM node:22-slim AS build +WORKDIR /app + +# Install build tools as a fallback for native modules without prebuilds +RUN apt-get update \ + && apt-get install -y --no-install-recommends python3 make g++ \ + && rm -rf /var/lib/apt/lists/* + +COPY package.json package-lock.json ./ +RUN npm ci + +COPY tsconfig.json vitest.config.ts ./ +COPY server ./server +RUN npm run build:server && npm test + +# ---- runtime stage ---- +FROM node:22-slim +ENV NODE_ENV=production +WORKDIR /app + +COPY package.json package-lock.json ./ +COPY --from=build /app/node_modules ./node_modules +COPY --from=build /app/server/dist ./server/dist + +ENV PORT=3000 +ENV DATA_DIR=/data +VOLUME /data +EXPOSE 3000 + +CMD ["node", "server/dist/index.js"] diff --git a/README.md b/README.md index d79fa2d..3fcc972 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ # record-shop -Easily manage a physical collection of music. \ No newline at end of file +Easily manage a physical collection of music. + +Scan barcodes with your phone to catalogue vinyl, CDs and cassettes, pull +metadata from Discogs, and see what you have (and haven't) ripped into your +Subsonic-compatible music server (Navidrome, Gonic, Airsonic, LMS, …). + +## Quickstart + +```bash +docker compose up -d +``` + +Open , create the admin account, then add your Discogs +token and (optionally) your Subsonic server details in Settings. + +- Data lives in `./data` (SQLite database + cached cover art). +- Configure via env if you prefer: `PORT`, `DATA_DIR`. + +## Development + +```bash +npm install +npm test # vitest +npm run dev:server +``` + +Spec: `docs/superpowers/specs/2026-08-29-record-shop-design.md` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8a1457d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + record-shop: + build: . + ports: + - "3000:3000" + volumes: + - ./data:/data + restart: unless-stopped