prasunsrivastava
commited on
Commit
·
0863b41
1
Parent(s):
05edc02
Updated the Dockerfile.
Browse files- Dockerfile +2 -5
Dockerfile
CHANGED
|
@@ -36,7 +36,7 @@ RUN mkdir -p /var/log/nginx && \
|
|
| 36 |
touch /var/run/nginx.pid && \
|
| 37 |
chown -R user:user /var/run/nginx.pid
|
| 38 |
|
| 39 |
-
# Switch to user
|
| 40 |
USER user
|
| 41 |
|
| 42 |
# Set the environment variables
|
|
@@ -47,13 +47,10 @@ ENV HOME=/home/user \
|
|
| 47 |
# Install the Python dependencies
|
| 48 |
RUN uv sync
|
| 49 |
|
| 50 |
-
# Switch back to root for the start script
|
| 51 |
-
USER root
|
| 52 |
-
|
| 53 |
# Create start script
|
| 54 |
RUN echo '#!/bin/bash\n\
|
| 55 |
nginx -g "daemon off;" &\n\
|
| 56 |
-
|
| 57 |
' > /app/start.sh && chmod +x /app/start.sh
|
| 58 |
|
| 59 |
# Expose the Hugging Face port
|
|
|
|
| 36 |
touch /var/run/nginx.pid && \
|
| 37 |
chown -R user:user /var/run/nginx.pid
|
| 38 |
|
| 39 |
+
# Switch to user
|
| 40 |
USER user
|
| 41 |
|
| 42 |
# Set the environment variables
|
|
|
|
| 47 |
# Install the Python dependencies
|
| 48 |
RUN uv sync
|
| 49 |
|
|
|
|
|
|
|
|
|
|
| 50 |
# Create start script
|
| 51 |
RUN echo '#!/bin/bash\n\
|
| 52 |
nginx -g "daemon off;" &\n\
|
| 53 |
+
source /app/.venv/bin/activate && exec uvicorn api:app --host 0.0.0.0 --port 8000\n\
|
| 54 |
' > /app/start.sh && chmod +x /app/start.sh
|
| 55 |
|
| 56 |
# Expose the Hugging Face port
|