Files
RushStatistics/Dockerfile
2025-06-01 18:33:31 -07:00

50 lines
1.0 KiB
Docker

# 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
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
COPY --from=0 /srv/cprush-stats /srv/cprush-stats
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
WORKDIR /srv/cprush-stats
RUN npm install
CMD ["node", "app.js"]