From 55c4496a57306aea63813de2ce83b6f7dde29ca8 Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Tue, 6 Feb 2024 16:25:34 +0200 Subject: [PATCH] Add DUK Integrator & the 230-form software --- Makefile | 6 ++++++ docker/dockerfiles/Dockerfile | 23 +++++++++++++++++++++++ docker/dockerfiles/Dockerfile.dev | 15 ++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8de38a1c..70d9ca24 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,12 @@ rund-psql: stop-mysql stop-sqlite upd-psql ## run the project with psql in de redo-psql: drop-psql up-psql ## delete the db and rerun the project with psql redod-psql: drop-psql upd-psql ## delete the db and rerun the project with psql in detached mode +### Using the production environment +run-prod: stop-mysql stop-sqlite stop-psql up-prod ## run the project with mysql and stop the sqlite project beforehand +rund-prod: stop-mysql stop-sqlite stop-psql upd-prod ## run the project with mysql in detached mode and stop the sqlite project beforehand +redo-prod: drop-prod up-prod ## delete the db and rerun the project with mysql +redod-prod: drop-prod upd-prod ## delete the db and rerun the project with mysql in detached mode + ### Other run options run: run-sqlite ## set the default run command to sqlite redo: redo-sqlite ## set the default redo command to sqlite diff --git a/docker/dockerfiles/Dockerfile b/docker/dockerfiles/Dockerfile index 966191d9..12013baa 100644 --- a/docker/dockerfiles/Dockerfile +++ b/docker/dockerfiles/Dockerfile @@ -41,6 +41,27 @@ COPY ./backend/requirements.txt . RUN python3 -m pip install --upgrade pip setuptools && \ python3 -m pip install -r ./requirements.txt + +FROM debian:bookworm-slim as dukintegrator + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ + unzip && \ + apt-get clean + +WORKDIR /var/www/dukintegrator/ + +ADD https://static.anaf.ro/static/DUKIntegrator/dist_javaInclus20200203.zip /tmp/duki/ +ADD https://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/D230_10042023.zip /tmp/d230/ + +RUN unzip /tmp/duki/dist_javaInclus20200203.zip -d /var/www/dukintegrator/ && \ + unzip /tmp/d230/D230_10042023.zip -d /var/www/dukintegrator/dist/lib/ && \ + rm -rf /tmp/duki && \ + rm -rf /tmp/d230 && \ + rm -rf /var/www/dukintegrator/dist/jre6 + + FROM python:3.11.7-slim-bookworm ENV PYTHONUNBUFFERED=1 @@ -91,6 +112,8 @@ COPY ./backend/ /var/www/redirect/backend/ COPY --from=frontend /home/builduser/redirect/build/bower_components/ /var/www/redirect/backend/bower_components/ +COPY --from=dukintegrator /var/www/dukintegrator/ /var/www/dukintegrator/ + # activate the virtualenv: RUN . "${VIRTUAL_ENV}/bin/activate" diff --git a/docker/dockerfiles/Dockerfile.dev b/docker/dockerfiles/Dockerfile.dev index e51298b4..73c94a75 100644 --- a/docker/dockerfiles/Dockerfile.dev +++ b/docker/dockerfiles/Dockerfile.dev @@ -21,7 +21,7 @@ RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ nginx gcc xz-utils gettext python3 python3-pip python3-venv python3-dev git postgresql-client libpq-dev \ - openjdk-17-jre-headless && \ + openjdk-17-jre-headless unzip && \ apt-get clean @@ -57,6 +57,19 @@ RUN python3 -m pip install --upgrade pip setuptools && \ RUN npm install -g npm bower && \ bower install --allow-root --config.interactive=false +# add the DUK Integrator +WORKDIR /var/www/dukintegrator/ + +ADD https://static.anaf.ro/static/DUKIntegrator/dist_javaInclus20200203.zip /tmp/duki/ +ADD https://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/D230_10042023.zip /tmp/d230/ + +RUN unzip /tmp/duki/dist_javaInclus20200203.zip -d /var/www/dukintegrator/ && \ + unzip /tmp/d230/D230_10042023.zip -d /var/www/dukintegrator/dist/lib && \ + rm -rf /tmp/duki && \ + rm -rf /tmp/d230 && \ + rm -rf /var/www/dukintegrator/dist/jre6 + + USER root