-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker_image and docker-compose for restapi
- Loading branch information
Vasu Jaganath
committed
Nov 12, 2024
1 parent
9797013
commit 51fee5f
Showing
2 changed files
with
44 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# IMPORTANT: Use .. for the Build Context https://docs.docker.com/build/building/context/ | ||
# i.e. `sudo docker build ... -f Dockerfile ..` | ||
FROM debian:stable-slim | ||
|
||
# Install conda / mamba | ||
RUN apt-get update -y && apt-get install -y wget | ||
|
||
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \ | ||
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \ | ||
chmod +x $CONDA && \ | ||
./$CONDA -b -p /miniforge && \ | ||
rm -f $CONDA | ||
ENV PATH /miniforge/bin:$PATH | ||
|
||
# Install sophios first | ||
RUN apt-get install -y git | ||
|
||
COPY . /workflow-inference-compiler | ||
WORKDIR /workflow-inference-compiler | ||
|
||
# This is a Docker image; we don't necessarily need to additionally isolate | ||
# wic within a conda environment. Let's just install it globally! | ||
RUN mamba env update --name base --file install/system_deps.yml | ||
RUN pip install -e ".[all]" | ||
|
||
RUN mamba clean --all --yes | ||
RUN pip cache purge | ||
RUN apt-get clean | ||
|
||
# Then run the sophios REST API through port 3000 | ||
EXPOSE 3000 | ||
|
||
CMD ["uvicorn", "sophios.api.http.restapi:app", "--host", "0.0.0.0", "--port", "3000"] | ||
|
||
ADD docker/Dockerfile_debian_rest . |
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,9 @@ | ||
version: '0.0.1' | ||
services: | ||
fastapi-app: | ||
image: vjaganat90/sophios-rest-api:0.0.1 | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- PATH=/miniforge/bin:$PATH | ||
command: ["uvicorn", "sophios.api.http.restapi:app", "--host", "0.0.0.0", "--port", "3000"] |