-
Notifications
You must be signed in to change notification settings - Fork 12
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
1 parent
d87f2b8
commit 487615d
Showing
6 changed files
with
62 additions
and
44 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
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,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"] |
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 |
---|---|---|
|
@@ -43,7 +43,3 @@ Pull latest changes | |
``` | ||
./deploy.sh | ||
``` | ||
|
||
|
||
|
||
|
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
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
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