diff --git a/Dockerfile b/Dockerfile index 2b32f9b3..54dd2202 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,9 @@ # ------------------------------------------------------------------------------------- # Container to serve FastAPI backend api from sbmlutils # ------------------------------------------------------------------------------------- -# https://fastapi.tiangolo.com/deployment/docker/ -# see https://github.com/tiangolo/uvicorn-gunicorn-docker for env variables +FROM python:3.12 -# build image -# docker build -t myimage . - -# start container -# docker run -d --name mycontainer -p 80:80 -e MODULE_NAME="sbmlutils.report.api" -e VARIABLE_NAME="api" myimage -# docker run -d --name mycontainer -p 80:80 myimage -# ------------------------------------------------------------------------------------- -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 - -# Caching of python requirements -# COPY ./requirements.txt /code/requirements.txt -# CMD pip install --requirement /code/requirements.txt - -# Adds application code to the image -# COPY . /code +# Add application code to the image COPY ./src /code/src COPY ./setup.cfg /code/setup.cfg COPY ./setup.py /code/setup.py @@ -31,13 +16,9 @@ WORKDIR /code # Install sbmlutils RUN pip install -e . --no-cache-dir --upgrade -ENV MODULE_NAME="sbmlutils.report.api" -ENV VARIABLE_NAME="api" -ENV PORT="1444" +#ENV MODULE_NAME="sbmlutils.report.api" +#ENV VARIABLE_NAME="api" +#ENV PORT="1444" -# EXPOSE 80 EXPOSE 1444 - -# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Gunicorn with Uvicorn -CMD ["/start.sh"] +CMD ["uvicorn", "sbmlutils.report.api:api", "--host", "0.0.0.0", "--port", "1444"] diff --git a/Dockerfile_old b/Dockerfile_old new file mode 100644 index 00000000..2b32f9b3 --- /dev/null +++ b/Dockerfile_old @@ -0,0 +1,43 @@ +# ------------------------------------------------------------------------------------- +# Container to serve FastAPI backend api from sbmlutils +# ------------------------------------------------------------------------------------- +# https://fastapi.tiangolo.com/deployment/docker/ +# see https://github.com/tiangolo/uvicorn-gunicorn-docker for env variables + +# build image +# docker build -t myimage . + +# start container +# docker run -d --name mycontainer -p 80:80 -e MODULE_NAME="sbmlutils.report.api" -e VARIABLE_NAME="api" myimage +# docker run -d --name mycontainer -p 80:80 myimage +# ------------------------------------------------------------------------------------- +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 + +# Caching of python requirements +# COPY ./requirements.txt /code/requirements.txt +# CMD pip install --requirement /code/requirements.txt + +# Adds application code to the image +# COPY . /code +COPY ./src /code/src +COPY ./setup.cfg /code/setup.cfg +COPY ./setup.py /code/setup.py +COPY ./README.rst /code/README.rst +COPY ./MANIFEST.in /code/MANIFEST.in +COPY ./LICENSE /code/LICENSE + +WORKDIR /code + +# Install sbmlutils +RUN pip install -e . --no-cache-dir --upgrade + +ENV MODULE_NAME="sbmlutils.report.api" +ENV VARIABLE_NAME="api" +ENV PORT="1444" + +# EXPOSE 80 +EXPOSE 1444 + +# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations) +# And then will start Gunicorn with Uvicorn +CMD ["/start.sh"] diff --git a/deploy.md b/deploy.md index b4e1e096..6b8fd829 100644 --- a/deploy.md +++ b/deploy.md @@ -43,7 +43,3 @@ Pull latest changes ``` ./deploy.sh ``` - - - - diff --git a/docker-compose-develop.yml b/docker-compose-develop.yml index 2e2fd339..574cbd71 100644 --- a/docker-compose-develop.yml +++ b/docker-compose-develop.yml @@ -3,13 +3,12 @@ # ----------------------------------------------------------------------------- # # build containers -# docker-compose -f docker-compose-develop.yml build --no-cache -# docker-compose -f docker-compose-develop.yml build +# docker compose -f docker-compose-develop.yml build --no-cache +# docker compose -f docker-compose-develop.yml build # serve containers -# docker-compose -f docker-compose-develop.yml up --detach -# docker-compose -f docker-compose-develop.yml up +# docker compose -f docker-compose-develop.yml up --detach +# docker compose -f docker-compose-develop.yml up # ----------------------------------------------------------------------------- - version: '3' volumes: @@ -29,7 +28,7 @@ services: - "80" ports: - "1444:80" - command: ["/start.sh"] + # command: ["/start.sh"] frontend: restart: always diff --git a/misc/xpp/xpp_models.py b/misc/xpp/xpp_models.py index 5a4d1cf6..99967cf8 100644 --- a/misc/xpp/xpp_models.py +++ b/misc/xpp/xpp_models.py @@ -142,7 +142,6 @@ def simulate(sbml_file): if __name__ == "__main__": - # download and unzip all sbml files # ode_all = get_models(download=True) diff --git a/setup.cfg b/setup.cfg index 8b8791d5..5464d8d8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,19 +60,21 @@ install_requires = numpy>=1.26.4 python-libsbml>=5.20.4 antimony>=2.15.0 - scipy>=1.14 pandas>=2.2.0 + tabulate>=0.9.0 pint>=0.24.3 - tabulate>=0.9.0 - beautifulsoup4>=4.12.3 + markdown-it-py>=3.0.0 openpyxl>=3.1.5 xmlschema>=3.3.2 - uvicorn>=0.30.6 matplotlib>=3.9 py4cytoscape>=1.9.0 - libroadrunner>=1.26.4 + libroadrunner>=1.27.0 + + uvicorn>=0.30.6 + fastapi>=0.112.0 + python-multipart>=0.0.9 tests_require = tox>=3.24.3 pytest>=7.0.1 @@ -90,9 +92,6 @@ test = pytest where = src [options.extras_require] -sbml4humans = - fastapi>=0.112.0 - python-multipart>=0.0.9 development = pip-tools>=7.4.1 black>=24.8.0 @@ -104,6 +103,7 @@ development = mypy>=1.4.1 pytest>=7.4.0 pytest-cov>=4.1.0 + beautifulsoup4>=4.12.3 docs = sphinx>=3.4.3 ipykernel>=5.4.3