33FROM node:lts-alpine3.21 AS frontend-build
44
55WORKDIR /
6+
7+ COPY frontend/package.json frontend/package-lock.json ./
8+ RUN npm install npm@11.11.0 --location=global && npm install
9+
610# copy react source code
711COPY frontend/ .
812# copy version file as an env file
913COPY docker/.env .env.local
10- # install and build
11- RUN npm install npm@latest --location=global \
12- && npm install \
13- && PUBLIC_URL=/static/reactapp/ npm run build
14+ RUN PUBLIC_URL=/static/reactapp/ npm run build
1415
1516# Stage 2: Backend
1617FROM python:3.11.7 AS backend-build
@@ -49,13 +50,15 @@ RUN apt-get update \
4950
5051COPY requirements/project-requirements.txt $PYTHONPATH/project-requirements.txt
5152COPY requirements/certego-requirements.txt $PYTHONPATH/certego-requirements.txt
53+ COPY requirements/django-server-requirements.txt $PYTHONPATH/requirements/django-server-requirements.txt
5254WORKDIR $PYTHONPATH
5355
5456RUN pip3 install --no-cache-dir --use-pep517 --compile -r project-requirements.txt \
5557 && pip3 install --no-cache-dir pycti==${PYCTI_VERSION} \
5658 && pip3 install --no-cache-dir --compile -r certego-requirements.txt
5759
58- COPY . $PYTHONPATH
60+ COPY api_app/analyzers_manager/repo_downloader.sh ${PYTHONPATH}/api_app/analyzers_manager/repo_downloader.sh
61+ COPY docker/scripts/watchman_install.sh ${PYTHONPATH}/docker/scripts/watchman_install.sh
5962
6063RUN touch ${LOG_PATH}/django/api_app.log ${LOG_PATH}/django/api_app_errors.log \
6164 && touch ${LOG_PATH}/django/intel_owl.log ${LOG_PATH}/django/intel_owl_errors.log \
@@ -65,10 +68,12 @@ RUN touch ${LOG_PATH}/django/api_app.log ${LOG_PATH}/django/api_app_errors.log \
6568 && touch ${LOG_PATH}/django/authentication.log ${LOG_PATH}/django/authentication_errors.log \
6669 && touch ${LOG_PATH}/asgi/daphne.log \
6770 && mkdir -p -m 755 ${PYTHONPATH}/.cache \
68- && chown -R www-data:www-data ${LOG_PATH} /opt/deploy/ ${PYTHONPATH}/.cache \
69- && ${PYTHONPATH}/docker/scripts/watchman_install.sh \
70- # download github stuff
71- && ${PYTHONPATH}/api_app/analyzers_manager/repo_downloader.sh
71+ && ${PYTHONPATH}/api_app/analyzers_manager/repo_downloader.sh \
72+ && ${PYTHONPATH}/docker/scripts/watchman_install.sh
73+
74+ COPY . $PYTHONPATH
75+
76+ RUN chown -R www-data:www-data ${LOG_PATH} /opt/deploy/ ${PYTHONPATH}/.cache
7277
7378FROM backend-build
7479
0 commit comments