FROM node:20-alpine

# Python is required by the API endpoints that shell out to convert_data.py,
# import_file.py, and pdf_generator.py.
RUN apk add --no-cache python3 py3-pip py3-reportlab py3-openpyxl

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY server/ ./server/
COPY i18n/ ./i18n/
COPY index.html script.js ./
COPY *.py ./

ENV NODE_ENV=production
ENV PORT=3102

EXPOSE 3102

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