-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,50 @@ | ||
# Builds an image for CTS calculator celery worker | ||
|
||
ARG version=dev | ||
|
||
FROM python:3.10.12-slim | ||
FROM mambaorg/micromamba:1.5.8-alpine3.19 | ||
|
||
ENV APP_USER=www-data | ||
ENV CONDA_ENV="pyenv" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y build-essential | ||
USER root | ||
|
||
COPY . /src/ | ||
RUN adduser -S $APP_USER -G $APP_USER | ||
|
||
RUN apk add --update --no-cache \ | ||
build-base \ | ||
jpeg-dev \ | ||
zlib-dev \ | ||
libjpeg \ | ||
gettext \ | ||
py3-lxml \ | ||
py3-pillow \ | ||
openldap-dev \ | ||
python3-dev \ | ||
linux-headers \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
COPY . /src/ | ||
WORKDIR /src | ||
|
||
RUN pip install -r requirements.txt | ||
RUN micromamba create -n $CONDA_ENV -c conda-forge python=3.10 | ||
RUN micromamba install -n $CONDA_ENV -f /src/environment.yml | ||
RUN micromamba clean -p -t -l --trash -y | ||
RUN micromamba run -n $CONDA_ENV pip uninstall -y xhtml2pdf && micromamba run -n $CONDA_ENV pip install xhtml2pdf | ||
|
||
ENV PYTHONPATH /src:$PYTHONPATH | ||
ENV PATH /src:$PATH | ||
|
||
# Removes any trace of pip to resolve an open CVE. | ||
# TODO: Generalize this using "find" (see hms). | ||
RUN rm -rf \ | ||
/root/.cache/pip \ | ||
/usr/local/bin/pip \ | ||
/usr/local/bin/pip3.10 \ | ||
/usr/local/bin/pip3 \ | ||
/usr/local/lib/python3.10/site-packages/pip \ | ||
/usr/local/lib/python3.10/site-packages/pip-23.0.1.dist-info | ||
# # Removes any trace of pip to resolve an open CVE: | ||
# RUN rm -rf \ | ||
# /root/.cache/pip \ | ||
# /usr/local/bin/pip \ | ||
# /usr/local/bin/pip3.10 \ | ||
# /usr/local/bin/pip3 \ | ||
# /usr/local/lib/python3.10/site-packages/pip \ | ||
# /usr/local/lib/python3.10/site-packages/pip-23.0.1.dist-info | ||
|
||
RUN chown -R $APP_USER:$APP_USER /src | ||
|
||
USER $APP_USER | ||
ENV DJANGO_SETTINGS_MODULE "settings" | ||
EXPOSE 8080 | ||
|
||
ENV PYTHONPATH /src:$PYTHONPATH | ||
ENV PATH /src:$PATH | ||
|
||
USER $APP_USER |
Submodule cts_calcs
updated
8 files
+4 −2 | actorws.py | |
+4 −4 | calculator.py | |
+42 −3 | calculator_chemaxon.py | |
+1 −1 | calculator_metabolizer.py | |
+80 −0 | calculator_molgpka.py | |
+11 −28 | calculator_pkasolver.py | |
+3 −1 | ccte.py | |
+3 −1 | chemical_information.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: cts | ||
channels: | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- beautifulsoup4=4.12.3 | ||
- celery=5.3.6 | ||
- pymongo=4.6.3 | ||
- python-dotenv=1.0.1 | ||
- rdkit=2024.3.1 | ||
- requests=2.31.0 | ||
- pip: | ||
- redis==5.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
micromamba run -n pyenv celery -A tasks worker -Q manager_queue -l info -n manager_worker -c 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
micromamba run -n pyenv celery -A tasks worker -Q cts_queue -l info -n cts_worker -c 1 |