message
Browse files- Dockerfile +15 -16
Dockerfile
CHANGED
|
@@ -1,22 +1,21 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
ENV HF_HOME=/app/.cache
|
| 7 |
-
|
| 8 |
-
RUN mkdir -p /app/.cache/huggingface/hub && \
|
| 9 |
-
chmod -R 777 /app/.cache && \
|
| 10 |
-
chmod -R 777 /app/.cache/huggingface
|
| 11 |
|
|
|
|
|
|
|
| 12 |
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
| 18 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
| 1 |
+
# Use an official Python image as a base
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# Install dependencies
|
| 9 |
+
RUN pip install --no-cache-dir fastapi uvicorn
|
| 10 |
|
| 11 |
+
# Create a directory for the app
|
| 12 |
+
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Copy your application code
|
| 15 |
+
COPY . /app
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# Expose the port for the FastAPI app
|
| 18 |
+
EXPOSE 8000
|
| 19 |
|
| 20 |
+
# Run the application with Uvicorn
|
| 21 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|