FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
RUN npm install --omit=dev

COPY . .

ENV PORT=3000
EXPOSE 3001

# data/ and uploads/ are where persistent state lives -- mount these as
# volumes (see docker-compose.yml) so entries survive container restarts.
VOLUME ["/app/data", "/app/uploads"]

CMD ["node", "server.js"]
