Skip to content

Commit f8ed384

Browse files
committed
dockerfile modified-lm
1 parent da2b98e commit f8ed384

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
1-
# ✅ Podman + OpenShift safe base image
21
FROM python:3.11-slim-bookworm
32

4-
# Install build dependencies (single layer)
3+
WORKDIR /app
4+
55
RUN apt-get update && apt-get install -y \
66
curl \
77
gcc \
88
python3-dev \
99
build-essential \
10+
wget \
1011
&& rm -rf /var/lib/apt/lists/*
1112

12-
# OpenShift-compatible writable directories
13-
RUN mkdir -p /app /tmp/huggingface /mnt/hf_cache \
14-
&& chmod -R 777 /app /tmp/huggingface /mnt/hf_cache
15-
16-
# Set the working directory
17-
WORKDIR /app
13+
RUN mkdir -p /app /tmp/huggingface \
14+
&& chmod -R 777 /app /tmp/huggingface
1815

19-
# Hugging Face cache locations
2016
ENV HF_HOME=/tmp/huggingface
2117
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
18+
ENV PYTHONPATH=/app
2219

23-
# Copy requirements first for layer caching
2420
COPY requirements.txt .
25-
26-
# Install Python dependencies
2721
RUN pip install -r requirements.txt
2822

29-
# Copy application code
3023
COPY . .
3124

32-
# Ensure imports work
33-
ENV PYTHONPATH=/app
34-
35-
# Run FastAPI
36-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8002", "--log-level", "debug", "--access-log"]
25+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8002"]

0 commit comments

Comments
 (0)