Spaces:
Paused
Paused
Update Dockerfile
Browse files- 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
|
| 39 |
-
COPY
|
| 40 |
-
|
| 41 |
-
# Build React frontend
|
| 42 |
WORKDIR /app/frontend
|
| 43 |
-
RUN npm
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
WORKDIR /app
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
#
|
| 48 |
-
RUN
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
USER user
|
| 52 |
|
| 53 |
EXPOSE 7860
|
| 54 |
-
CMD ["
|
|
|
|
| 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"]
|