Skip to content

Commit

Permalink
dockerfile and app updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lfunderburk committed May 19, 2023
1 parent 227deb2 commit 6037977
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ notebooks/train_model.ipynb
notebooks/clustering.ipynb

*.db

*.pem
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use the official Python image as the base image
FROM python:3.10

# Set the working directory
WORKDIR /app

# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Expose the port that the app runs on
EXPOSE 8000

# Execute the script when the container starts
CMD ["uvicorn", "src.app.app:app", "--host", "0.0.0.0"]
28 changes: 0 additions & 28 deletions Dockerfile.api

This file was deleted.

6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.10'
services:
app:
build: .
ports:
- '8000:8000'
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ transformers==4.28.1
torch==2.0.0
openai
jupysql
fastapi==0.95.1
uvicorn==0.21.1
fastapi>=0.68.0,<0.69.0
pydantic>=1.8.0,<2.0.0
uvicorn>=0.15.0,<0.16.0
1 change: 0 additions & 1 deletion src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ async def search(query: Query):

except Exception as e:
return {"error": f"SQL query failed. {e}"}

0 comments on commit 6037977

Please sign in to comment.