FROM node:22-alpine

WORKDIR /app

ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=8080
ENV DATA_DIR=/data
ENV WEB_ROOT=/app/apps/web/public

COPY apps/server/package.json apps/server/package.json
COPY apps/server/src apps/server/src
COPY apps/web/public apps/web/public

RUN mkdir -p /data

EXPOSE 8080
VOLUME ["/data"]

CMD ["node", "apps/server/src/server.js"]
