Mr-Thop commited on
Commit
ddf44aa
·
verified ·
1 Parent(s): cf1e7e0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -35
Dockerfile CHANGED
@@ -1,35 +1,35 @@
1
- FROM python:3.10
2
-
3
- # Prevent Python from writing pyc files
4
- ENV PYTHONDONTWRITEBYTECODE=1
5
- ENV PYTHONUNBUFFERED=1
6
-
7
- # Create a non-root user (HF Spaces compatible)
8
- RUN useradd -m -u 1000 backenduser
9
- USER backenduser
10
-
11
- # Set PATH
12
- ENV PATH="/home/backenduser/.local/bin:$PATH"
13
-
14
- # Set working directory
15
- WORKDIR /app
16
-
17
- # Copy requirements first (better caching)
18
- COPY --chown=backenduser:backenduser requirements.txt /app/requirements.txt
19
-
20
- # Install dependencies
21
- RUN pip install --no-cache-dir --upgrade pip && \
22
- pip install --no-cache-dir -r requirements.txt
23
-
24
- # Copy backend source code
25
- COPY --chown=backenduser:backenduser . /app
26
-
27
- # Create required runtime directories
28
- RUN mkdir -p \
29
- resume \
30
- uploads \
31
- temp \
32
- logs
33
-
34
- COPY --chown=user . /app
35
- CMD ["gunicorn", "app:app", "--b", "0.0.0.0:7860"]
 
1
+ FROM python:3.10
2
+
3
+ # Prevent Python from writing pyc files
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ # Create a non-root user (HF Spaces compatible)
8
+ RUN useradd -m -u 1000 backenduser
9
+ USER backenduser
10
+
11
+ # Set PATH
12
+ ENV PATH="/home/backenduser/.local/bin:$PATH"
13
+
14
+ # Set working directory
15
+ WORKDIR /app
16
+
17
+ # Copy requirements first (better caching)
18
+ COPY --chown=backenduser:backenduser requirements.txt /app/requirements.txt
19
+
20
+ # Install dependencies
21
+ RUN pip install --no-cache-dir --upgrade pip && \
22
+ pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Copy backend source code
25
+ COPY --chown=backenduser:backenduser . /app
26
+
27
+ # Create required runtime directories
28
+ RUN mkdir -p \
29
+ resume \
30
+ uploads \
31
+ temp \
32
+ logs
33
+
34
+ COPY --chown=user . /app
35
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860"]