Spaces:
Paused
Paused
Commit
·
1ce5c45
1
Parent(s):
dd4ba61
Fixed Dockerfile
Browse files- Dockerfile +10 -17
Dockerfile
CHANGED
@@ -1,33 +1,26 @@
|
|
1 |
-
# Start from NVIDIA CUDA base image
|
2 |
-
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
python3.12 \
|
10 |
-
python3-pip \
|
11 |
-
git \
|
12 |
-
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
# Copy requirements first to leverage Docker cache
|
15 |
COPY requirements.txt .
|
16 |
|
17 |
-
# Install
|
18 |
-
RUN
|
19 |
|
20 |
# Copy the application code
|
21 |
COPY ./app /code/app
|
22 |
COPY ./utils /code/utils
|
23 |
|
24 |
# Set environment variables
|
25 |
-
ENV PYTHONPATH=/
|
26 |
-
ENV
|
27 |
-
ENV CUDA_VISIBLE_DEVICES=0
|
28 |
|
29 |
-
# Expose the port
|
30 |
-
EXPOSE
|
31 |
|
32 |
# Command to run the application
|
33 |
CMD ["python3", "-m", "app.main"]
|
|
|
|
|
|
|
1 |
|
2 |
+
# Use Python 3.12 slim image as base
|
3 |
+
FROM python:3.12-slim
|
4 |
|
5 |
+
# Set working directory
|
6 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# Copy requirements first to leverage Docker cache
|
9 |
COPY requirements.txt .
|
10 |
|
11 |
+
# Install dependencies
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
# Copy the application code
|
15 |
COPY ./app /code/app
|
16 |
COPY ./utils /code/utils
|
17 |
|
18 |
# Set environment variables
|
19 |
+
ENV PYTHONPATH=/app
|
20 |
+
ENV PYTHONUNBUFFERED=1
|
|
|
21 |
|
22 |
+
# Expose the port your application runs on (assuming 8002 from your config)
|
23 |
+
EXPOSE 7680
|
24 |
|
25 |
# Command to run the application
|
26 |
CMD ["python3", "-m", "app.main"]
|