Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
c80bb33
1
Parent(s):
9da6b72
- Dockerfile +4 -6
Dockerfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
|
3 |
|
4 |
|
5 |
-
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 curl nginx -y
|
6 |
|
7 |
# Set the working directory to /code
|
8 |
WORKDIR /code
|
@@ -59,6 +59,9 @@ RUN echo 'server {' > /etc/nginx/sites-available/default && \
|
|
59 |
echo ' }' >> /etc/nginx/sites-available/default && \
|
60 |
echo '}' >> /etc/nginx/sites-available/default
|
61 |
|
|
|
|
|
|
|
62 |
USER user
|
63 |
|
64 |
# Create a startup script for HF Spaces with nginx
|
@@ -156,9 +159,4 @@ RUN echo '#!/bin/bash' > start_hf_spaces.sh && \
|
|
156 |
echo 'kill $TAIL_PID 2>/dev/null || true' >> start_hf_spaces.sh && \
|
157 |
chmod +x start_hf_spaces.sh
|
158 |
|
159 |
-
# Give user sudo permissions for nginx
|
160 |
-
USER root
|
161 |
-
RUN echo "user ALL=(ALL) NOPASSWD: /usr/sbin/nginx, /usr/sbin/nginx -t, /usr/sbin/nginx -s quit" >> /etc/sudoers
|
162 |
-
USER user
|
163 |
-
|
164 |
CMD ["bash", "start_hf_spaces.sh"]
|
|
|
2 |
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
|
3 |
|
4 |
|
5 |
+
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 curl nginx sudo -y
|
6 |
|
7 |
# Set the working directory to /code
|
8 |
WORKDIR /code
|
|
|
59 |
echo ' }' >> /etc/nginx/sites-available/default && \
|
60 |
echo '}' >> /etc/nginx/sites-available/default
|
61 |
|
62 |
+
# Give user sudo permissions for nginx
|
63 |
+
RUN echo "user ALL=(ALL) NOPASSWD: /usr/sbin/nginx, /usr/sbin/nginx -t, /usr/sbin/nginx -s quit" >> /etc/sudoers
|
64 |
+
|
65 |
USER user
|
66 |
|
67 |
# Create a startup script for HF Spaces with nginx
|
|
|
159 |
echo 'kill $TAIL_PID 2>/dev/null || true' >> start_hf_spaces.sh && \
|
160 |
chmod +x start_hf_spaces.sh
|
161 |
|
|
|
|
|
|
|
|
|
|
|
162 |
CMD ["bash", "start_hf_spaces.sh"]
|