Skip to content

Commit

Permalink
docker_image and docker-compose for restapi (#296)
Browse files Browse the repository at this point in the history
* docker_image and docker-compose for restapi

* Refactor Dockerfile

* rename Docker file from debian to ubuntu

---------

Co-authored-by: Vasu Jaganath <vasu.jaganath@axleinfo.com>
Co-authored-by: sameeul <sameeul@gmail.com>
  • Loading branch information
3 people authored Nov 18, 2024
1 parent 131e4a8 commit 5e84d68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/Dockerfile_ubuntu_REST
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:jammy

RUN apt update && \
apt install software-properties-common -y && \
apt install curl -y && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*

COPY . /workflow-inference-compiler
WORKDIR /workflow-inference-compiler

RUN pip3 install /workflow-inference-compiler --no-cache-dir

# 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"]
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=$PATH
command: ["uvicorn", "sophios.api.http.restapi:app", "--host", "0.0.0.0", "--port", "3000"]

0 comments on commit 5e84d68

Please sign in to comment.