Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +37 -46
Dockerfile
CHANGED
|
@@ -1,46 +1,37 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
RUN
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
# COPY sys7_phrase_lexicons_desc_only.json . <-- Uncomment if you use this
|
| 39 |
-
|
| 40 |
-
# Copy the runner script
|
| 41 |
-
COPY start.sh .
|
| 42 |
-
RUN chmod +x start.sh && chown -R appuser:appuser /app
|
| 43 |
-
|
| 44 |
-
USER appuser
|
| 45 |
-
|
| 46 |
-
CMD ["./start.sh"]
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
|
| 2 |
+
|
| 3 |
+
# 1. Install Python, git, AND 'dos2unix' (the magic fixer tool)
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
python3.10 \
|
| 6 |
+
python3-pip \
|
| 7 |
+
git \
|
| 8 |
+
git-lfs \
|
| 9 |
+
dos2unix \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# 2. Set up Python alias
|
| 13 |
+
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
| 14 |
+
|
| 15 |
+
WORKDIR /app
|
| 16 |
+
|
| 17 |
+
# 3. Install Python dependencies
|
| 18 |
+
COPY requirements.txt .
|
| 19 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 20 |
+
pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# 4. Copy all your scripts and configs
|
| 23 |
+
COPY sys7_miner.py .
|
| 24 |
+
COPY system7_lexicons.json .
|
| 25 |
+
COPY label_orders.json .
|
| 26 |
+
COPY slang_lexicon.json .
|
| 27 |
+
COPY run_job.py .
|
| 28 |
+
|
| 29 |
+
# 5. THE FIX: Convert all scripts to Unix line endings
|
| 30 |
+
# This fixes 'run_job.py' and any other text file that might have Windows formatting
|
| 31 |
+
RUN dos2unix run_job.py sys7_miner.py
|
| 32 |
+
|
| 33 |
+
# 6. Permissions
|
| 34 |
+
RUN chmod +x run_job.py
|
| 35 |
+
|
| 36 |
+
# 7. Run the job
|
| 37 |
+
CMD ["python", "run_job.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|