Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add java in the container #163

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# file generated at some point
myfile.dat

*.pyc

bower_components/
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 26 additions & 1 deletion docker/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -63,7 +84,9 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
nginx gcc xz-utils gettext
nginx gcc xz-utils gettext \
openjdk-17-jre-headless


# configure process manager
ARG S6_OVERLAY_VERSION=3.1.2.1
Expand All @@ -89,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"

Expand Down
18 changes: 17 additions & 1 deletion docker/dockerfiles/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ ENV DEBIAN_FRONTEND=noninteractive
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 && \
nginx gcc xz-utils gettext python3 python3-pip python3-venv python3-dev git postgresql-client libpq-dev \
openjdk-17-jre-headless unzip && \
apt-get clean


Expand Down Expand Up @@ -56,6 +57,21 @@ 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 \

COPY ./docker/xml/ /var/www/dukintegrator/dist/xml/


USER root


Expand Down