diff --git a/Cloud_dockerfile b/Cloud_dockerfile index e2958045..a71e5f0b 100644 --- a/Cloud_dockerfile +++ b/Cloud_dockerfile @@ -4,6 +4,11 @@ COPY bin /binaries/xtb COPY scripts /calcus/scripts RUN python /calcus/scripts/extract_xtb.py +RUN apt update && apt install build-essential gcc libxm4 libgl1 libmagic1 -y + +ADD ./cloud_requirements.txt /calcus/cloud_requirements.txt +RUN pip install -r /calcus/cloud_requirements.txt + FROM python:3.9-slim-bookworm AS calcus_user COPY --from=0 /binaries/ /binaries/ @@ -14,10 +19,9 @@ ENV CALCUS_VERSION_HASH=${CALCUS_VERSION_HASH} ENV PYTHONUNBUFFERED 1 ENV CALCUS_CLOUD True -RUN apt update && apt install openbabel postgresql-client dos2unix nwchem libxm4 libgl1 libmagic1 -y +COPY --from=0 /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages -ADD ./cloud_requirements.txt /calcus/cloud_requirements.txt -RUN pip install -r /calcus/cloud_requirements.txt +RUN apt update && apt install openbabel postgresql-client dos2unix nwchem libxm4 libgl1 libmagic1 -y COPY calcus /calcus/calcus COPY frontend /calcus/frontend @@ -35,4 +39,4 @@ ENV PATH=$PATH:$XTB4STDAHOME/xtb/bin:$XTB4STDAHOME RUN adduser --disabled-password --gecos '' calcus -CMD exec gunicorn calcus.wsgi:application --bind :$PORT --timeout 10 --workers $NUM_WORKERS --threads $NUM_THREADS --timeout $GUNICORN_TIMEOUT +CMD exec python -m gunicorn calcus.wsgi:application --bind :$PORT --timeout 10 --workers $NUM_WORKERS --threads $NUM_THREADS --timeout $GUNICORN_TIMEOUT diff --git a/cloud_requirements.txt b/cloud_requirements.txt index 4302bc03..7cf457d9 100644 --- a/cloud_requirements.txt +++ b/cloud_requirements.txt @@ -21,7 +21,7 @@ nmrglue==0.8 numpy periodictable psutil==5.7.2 -psycopg2 +psycopg2-binary pysisyphus python-magic rdkit diff --git a/requirements.txt b/requirements.txt index e12ec57a..a83bece2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ paramiko==3.4.0 periodictable pre-commit psutil==5.7.2 -psycopg2 +psycopg2-binary pysisyphus python-magic rdkit diff --git a/scripts/run_web.sh b/scripts/run_web.sh index 50013b02..5a937fda 100755 --- a/scripts/run_web.sh +++ b/scripts/run_web.sh @@ -4,4 +4,4 @@ python scripts/wait_for_postgres.py ./scripts/migrate.sh python manage.py check_su -gunicorn calcus.wsgi:application --bind 0.0.0.0:8000 --access-logfile=- --error-logfile=- --reload --timeout $GUNICORN_TIMEOUT --keep-alive $GUNICORN_TIMEOUT +python -m gunicorn calcus.wsgi:application --bind 0.0.0.0:8000 --access-logfile=- --error-logfile=- --reload --timeout $GUNICORN_TIMEOUT --keep-alive $GUNICORN_TIMEOUT