dockerize this shit
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
Dockerfile
|
||||
.git
|
||||
.gitignore
|
||||
dist/**
|
||||
README.md
|
||||
50
Dockerfile
Normal file
50
Dockerfile
Normal file
@@ -0,0 +1,50 @@
|
||||
# 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"]
|
||||
5
docker-compose.yaml
Normal file
5
docker-compose.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
services:
|
||||
cprush:
|
||||
image: potato
|
||||
ports:
|
||||
- 3001:3001
|
||||
1
loader/loader-crm
Normal file
1
loader/loader-crm
Normal file
@@ -0,0 +1 @@
|
||||
*/10 * * * * python3 /loader/createrushdatabase.py
|
||||
Reference in New Issue
Block a user