hannabaker commited on
Commit
5dfcb2d
·
verified ·
1 Parent(s): 2c0b349

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -13
Dockerfile CHANGED
@@ -28,27 +28,31 @@ RUN git clone https://xff.cz/git/megatools && \
28
  ninja -C build install && \
29
  cd .. && rm -rf megatools
30
 
31
- # Create HF user
32
- RUN useradd -m -u 1000 user
33
-
34
  # Copy and install Python requirements
35
  COPY requirements.txt .
36
  RUN pip install --no-cache-dir -r requirements.txt
37
 
38
- # Copy application files
39
- COPY . .
40
-
41
- # Build React frontend
42
  WORKDIR /app/frontend
43
- RUN npm install && npm run build
44
-
 
 
 
 
 
 
45
  WORKDIR /app
 
 
46
 
47
- # Set permissions
48
- RUN chown -R 1000:1000 /app
49
- RUN mkdir -p /tmp/vod-archiver && chown -R 1000:1000 /tmp/vod-archiver
 
50
 
51
  USER user
52
 
53
  EXPOSE 7860
54
- CMD ["gunicorn", "-w", "4", "-k", "eventlet", "-b", "0.0.0.0:7860", "app:app"]
 
28
  ninja -C build install && \
29
  cd .. && rm -rf megatools
30
 
 
 
 
31
  # Copy and install Python requirements
32
  COPY requirements.txt .
33
  RUN pip install --no-cache-dir -r requirements.txt
34
 
35
+ # Copy frontend files and build
36
+ COPY frontend/package*.json ./frontend/
 
 
37
  WORKDIR /app/frontend
38
+ RUN npm ci --only=production
39
+ COPY frontend/public ./public
40
+ COPY frontend/src ./src
41
+ RUN npm run build && \
42
+ # Remove node_modules after build to save space
43
+ rm -rf node_modules
44
+
45
+ # Copy backend files
46
  WORKDIR /app
47
+ COPY *.py ./
48
+ COPY providers ./providers/
49
 
50
+ # Create HF user and set permissions efficiently
51
+ RUN useradd -m -u 1000 user && \
52
+ mkdir -p /tmp/vod-archiver && \
53
+ chown -R 1000:1000 /app /tmp/vod-archiver
54
 
55
  USER user
56
 
57
  EXPOSE 7860
58
+ CMD ["python", "app.py"]