Create dockerfile
Browse files- dockerfile +18 -0
dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
+
|
3 |
+
# Prevent Python from writing .pyc files and using buffered output
|
4 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
+
|
7 |
+
# Set working directory
|
8 |
+
WORKDIR /app
|
9 |
+
|
10 |
+
# Install dependencies
|
11 |
+
COPY requirements.txt .
|
12 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
13 |
+
|
14 |
+
# Copy source code
|
15 |
+
COPY main.py .
|
16 |
+
|
17 |
+
# Run the app with Uvicorn
|
18 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|