SushantGautam commited on
Commit
c0e1751
Β·
1 Parent(s): 0a9c507

Remove huggingface-cli login command and streamline CMD for static file collection in Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -5
Dockerfile CHANGED
@@ -21,7 +21,6 @@ WORKDIR /app
21
  # Install Python dependencies (cached as long as requirements.txt doesn't change)
22
  COPY requirements.txt .
23
  RUN pip install --upgrade pip && pip install -r requirements.txt
24
- RUN huggingface-cli login --token ${HF_TOKEN}
25
 
26
  # Copy project files (this step is later to allow caching of pip install)
27
  COPY . .
@@ -30,9 +29,6 @@ COPY . .
30
  RUN mkdir -p /root/.ssh && \
31
  ssh-keyscan -H 192.250.235.27 >> /root/.ssh/known_hosts
32
 
33
- # Collect static files (cached unless code changes)
34
- RUN INSIDEDOCKER=0 python manage.py collectstatic --noinput
35
-
36
  # Output IP address for debugging
37
  RUN echo "----------------------------------------" && \
38
  echo "🌍 Public IP of Docker host (from inside container):" && \
@@ -42,4 +38,4 @@ RUN echo "----------------------------------------" && \
42
  # Default CMD (use Gunicorn in production)
43
  CMD ["gunicorn", "BridgeMentor.wsgi:application", "--bind", "0.0.0.0:7860", "--timeout", "30", "--workers", "2"]
44
 
45
- # CMD ["python", "manage.py", "runserver", "7860", "--verbosity", "2", "--noreload"]
 
21
  # Install Python dependencies (cached as long as requirements.txt doesn't change)
22
  COPY requirements.txt .
23
  RUN pip install --upgrade pip && pip install -r requirements.txt
 
24
 
25
  # Copy project files (this step is later to allow caching of pip install)
26
  COPY . .
 
29
  RUN mkdir -p /root/.ssh && \
30
  ssh-keyscan -H 192.250.235.27 >> /root/.ssh/known_hosts
31
 
 
 
 
32
  # Output IP address for debugging
33
  RUN echo "----------------------------------------" && \
34
  echo "🌍 Public IP of Docker host (from inside container):" && \
 
38
  # Default CMD (use Gunicorn in production)
39
  CMD ["gunicorn", "BridgeMentor.wsgi:application", "--bind", "0.0.0.0:7860", "--timeout", "30", "--workers", "2"]
40
 
41
+ CMD ["/bin/bash", "-c", "python manage.py collectstatic --noinput && gunicorn BridgeMentor.wsgi:application --bind 0.0.0.0:7860 --timeout 30 --workers 2"]