Skip to content

Commit

Permalink
containerize the web service
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Liang committed Jan 31, 2024
1 parent 181298c commit f10a9c7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.9

EXPOSE 8000

WORKDIR /app

COPY requirements.txt ./requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "uvicorn", "app2:api", "--port=8000", "--host=0.0.0.0"]
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'
services:
fastapi-svc:
build:
context: .
ports:
- 8000:8000 # Map port 8000 (container) to (host)

0 comments on commit f10a9c7

Please sign in to comment.