ihtesham0345 commited on
Commit
dabf81a
·
verified ·
1 Parent(s): d8960f8

Docker file is add

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create a non-root user for Hugging Face security
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ WORKDIR /app
9
+
10
+ # Install dependencies
11
+ COPY --chown=user ./requirements.txt requirements.txt
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
+
14
+ # Copy all project files
15
+ COPY --chown=user . /app
16
+
17
+ # 1. Run migrations to create the database
18
+ # 2. Start the server on port 7860 using Gunicorn
19
+ CMD python manage.py migrate && \
20
+ gunicorn todo_project.wsgi:application --bind 0.0.0.0:7860