message
Browse files- Dockerfile +23 -9
- app.py → main.py +0 -0
Dockerfile
CHANGED
|
@@ -1,21 +1,35 @@
|
|
| 1 |
-
# Use an official Python image as
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Create a directory for the app
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
-
COPY . /app
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
EXPOSE 8000
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
CMD ["uvicorn", "
|
|
|
|
| 1 |
+
# Use an official Python image as the base image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set environment variables to prevent Python from buffering output
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
+
# Install necessary system dependencies
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
build-essential \
|
| 11 |
+
libopenblas-dev \
|
| 12 |
+
liblapack-dev \
|
| 13 |
+
libglib2.0-0 \
|
| 14 |
+
libgl1-mesa-glx \
|
| 15 |
+
libstdc++6 \
|
| 16 |
+
wget \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
# Create a directory for the app
|
| 20 |
WORKDIR /app
|
| 21 |
|
| 22 |
+
# Copy the requirements file
|
| 23 |
+
COPY requirements.txt /app/
|
| 24 |
|
| 25 |
+
# Install Python dependencies
|
| 26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
+
|
| 28 |
+
# Copy the application code
|
| 29 |
+
COPY . /app/
|
| 30 |
+
|
| 31 |
+
# Expose the FastAPI application port
|
| 32 |
EXPOSE 8000
|
| 33 |
|
| 34 |
+
# Command to run the application
|
| 35 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
app.py → main.py
RENAMED
|
File without changes
|