Skip to content

Commit

Permalink
docker_image and docker-compose for restapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasu Jaganath committed Nov 12, 2024
1 parent 9797013 commit 51fee5f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docker/Dockerfile_debian_rest
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 .
9 changes: 9 additions & 0 deletions docker/docker-compose.yml
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"]

0 comments on commit 51fee5f

Please sign in to comment.