Spaces:
Running
Running
“vinit5112”
commited on
Commit
·
748c488
1
Parent(s):
9f242de
fix: ensure nginx has access to writable temp directories
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
@@ -15,6 +15,7 @@ RUN npm run build
|
|
15 |
# Stage 2: Build Python backend + serve frontend with Nginx
|
16 |
FROM python:3.9-slim
|
17 |
|
|
|
18 |
WORKDIR /app
|
19 |
|
20 |
# Install Python dependencies
|
@@ -37,11 +38,16 @@ COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
|
37 |
RUN rm -rf /usr/share/nginx/html && \
|
38 |
ln -s /app/frontend_build /usr/share/nginx/html
|
39 |
|
40 |
-
#
|
|
|
|
|
|
|
|
|
41 |
COPY start.sh /start.sh
|
42 |
RUN chmod +x /start.sh
|
43 |
|
44 |
-
# Expose Hugging Face
|
45 |
EXPOSE 7860
|
46 |
|
|
|
47 |
CMD ["/start.sh"]
|
|
|
15 |
# Stage 2: Build Python backend + serve frontend with Nginx
|
16 |
FROM python:3.9-slim
|
17 |
|
18 |
+
# Set working directory
|
19 |
WORKDIR /app
|
20 |
|
21 |
# Install Python dependencies
|
|
|
38 |
RUN rm -rf /usr/share/nginx/html && \
|
39 |
ln -s /app/frontend_build /usr/share/nginx/html
|
40 |
|
41 |
+
# Create writable temp dirs for nginx to avoid permission error
|
42 |
+
RUN mkdir -p /app/tmp/body /app/tmp/proxy /app/tmp/fastcgi /app/tmp/uwsgi /app/tmp/scgi && \
|
43 |
+
chmod -R 777 /app/tmp
|
44 |
+
|
45 |
+
# Copy start script
|
46 |
COPY start.sh /start.sh
|
47 |
RUN chmod +x /start.sh
|
48 |
|
49 |
+
# Expose port 7860 for Hugging Face
|
50 |
EXPOSE 7860
|
51 |
|
52 |
+
# Start both backend and nginx
|
53 |
CMD ["/start.sh"]
|