Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -9
Dockerfile
CHANGED
@@ -1,19 +1,28 @@
|
|
1 |
-
# Use a Python base image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
8 |
-
RUN apt-get update && apt-get install -y libgl1-mesa-glx && rm -rf /var/lib/apt/lists/*
|
9 |
-
|
10 |
-
# Copy files
|
11 |
COPY . /app
|
12 |
|
13 |
-
# Install Python
|
14 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
# Create writable cache/config directories
|
17 |
RUN mkdir -p /app/cache/matplotlib && \
|
18 |
mkdir -p /app/cache/torchxrayvision && \
|
19 |
chmod -R 777 /app/cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a minimal Python base image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy all files to the container
|
|
|
|
|
|
|
8 |
COPY . /app
|
9 |
|
10 |
+
# Install system dependencies (for some Python packages like numpy, pandas, etc.)
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
build-essential \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
# Upgrade pip and install Python dependencies
|
16 |
+
RUN pip install --upgrade pip && \
|
17 |
+
pip install -r requirements.txt
|
18 |
|
19 |
+
# Create writable cache/config directories (if needed by your app)
|
20 |
RUN mkdir -p /app/cache/matplotlib && \
|
21 |
mkdir -p /app/cache/torchxrayvision && \
|
22 |
chmod -R 777 /app/cache
|
23 |
+
|
24 |
+
# Expose a port if your app runs on one (optional, usually 8000 for FastAPI/Uvicorn)
|
25 |
+
EXPOSE 8000
|
26 |
+
|
27 |
+
# Default command (adjust if your main file is different or uses gunicorn, etc.)
|
28 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|