File size: 577 Bytes
8161a0a
 
85034ff
8161a0a
 
 
 
34a4d1e
8161a0a
 
f9050af
8161a0a
 
 
f9050af
 
 
8161a0a
ddd3775
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Use nginx:alpine to allow apk installs under root
FROM nginx:alpine

# Install Python + Uvicorn
RUN apk update \
 && apk add --no-cache python3 py3-pip \
 && pip3 install --no-cache-dir fastapi uvicorn gradio

WORKDIR /app
COPY main.py requirements.txt nginx.conf ./

# Create temp dirs and adjust permissions
RUN mkdir -p /tmp/nginx/{client_body_temp,proxy_temp,fastcgi_temp,uwsgi_temp,scgi_temp} \
 && chmod -R 777 /tmp/nginx

EXPOSE 7860

# Run Uvicorn + Nginx together
CMD ["sh", "-c", "python3 -m uvicorn main:app --host 127.0.0.1 --port 8000 & nginx -g 'daemon off;'"]