feat: simplify dockerfile to use the frontend makefile

This commit is contained in:
Ana Custura 2024-12-03 11:39:12 +00:00
parent 0867b13f8f
commit 3c3a1485e7

View file

@ -35,7 +35,7 @@ RUN curl -fsSL https://get.opentofu.org/opentofu.gpg -o opentofu.gpg && \
rm -rf opentofu.tar.gz opentofu.tar.gz.gpgsig opentofu.gpg /tmp/* /var/tmp/*
RUN apt-get update && \
apt-get install --no-install-recommends -y curl sudo && \
apt-get install --no-install-recommends -y curl sudo make && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -55,11 +55,5 @@ RUN python3 -m venv ${APP_BASE}/env && \
${APP_BASE}/env/bin/pip install --no-cache-dir -r requirements.txt && \
${APP_BASE}/env/bin/pip install --no-cache-dir psycopg2-binary gunicorn
RUN rm -rf frontend && \
git clone https://gitlab.com/guardianproject-ops/bypass-censorship/portal-frontend.git frontend && \
cd frontend && npm install && npm run build && \
mkdir -p ${APP_BASE}/${APP}/app/static/ui && \
cp -r dist/* ${APP_BASE}/${APP}/app/static/ui && \
rm -rf frontend /tmp/* /var/tmp/*
RUN make install-frontend
ENTRYPOINT ["./run_gunicorn.sh"]