# FROM ubuntu:24.04 # ADD ./loader/loader-crm /etc/cron.d/loader-crm # RUN chmod 0644 /etc/cron/loader-crm # RUN touch /var/log/chron.log # RUN apt-get update # RUN apt-get -y install cron # RUN systemctl enable cron # Setup the loader FROM python:3.12 AS loader COPY ./loader /srv/cprush-stats WORKDIR /srv/cprush-stats RUN python -m pip install --upgrade pip RUN pip install -r requirements.txt CMD ["python3", "createrushdatabase.py"] FROM node:23 RUN corepack enable # build the frontend COPY ./frontend /frontend WORKDIR /frontend RUN npm install RUN npm run build RUN mkdir -p /srv/cprush-stats/frontend RUN cp -rf ./dist/* /srv/cprush-stats/frontend # build the backend COPY ./backend /backend WORKDIR /backend RUN npm install RUN npm run build RUN mkdir -p /srv/cprush-stats RUN cp -rf ./dist/* /srv/cprush-stats RUN cp package.json /srv/cprush-stats/package.json WORKDIR loader EXPOSE 3001 ENV NODE_ENV=production ENV MEMCACHE_ADDR="localhost:11211" COPY --from=loader /srv/cprush-stats/testdb.db /srv/cprush-stats/testdb.db WORKDIR /srv/cprush-stats RUN npm install CMD ["sh", "-c", "node app.js -m $MEMCACHE_ADDR"]