Spaces:
Build error
Build error
FROM nginxinc/nginx-unprivileged:1.25-alpine | |
WORKDIR /app | |
# Copy Python app and config | |
COPY requirements.txt main.py nginx.conf ./ | |
# Install Python and Uvicorn | |
RUN apk add --no-cache python3 py3-pip \ | |
&& pip install --no-cache-dir -r requirements.txt | |
# Ensure /tmp and subdirs exist for nginx temp files | |
RUN mkdir -p /tmp/nginx-client-temp \ | |
&& mkdir -p /tmp/nginx-proxy-temp \ | |
&& mkdir -p /tmp/nginx-fastcgi-temp \ | |
&& mkdir -p /tmp/nginx-uwsgi-temp \ | |
&& mkdir -p /tmp/nginx-scgi-temp | |
EXPOSE 7860 | |
CMD ["sh", "-c", "python3 -m uvicorn main:app --host 127.0.0.1 --port 8000 & nginx -g 'daemon off;'"] | |