File size: 625 Bytes
ddd3775
85034ff
f9050af
85034ff
ddd3775
f9050af
34a4d1e
ddd3775
 
 
f9050af
ddd3775
 
 
 
 
 
f9050af
 
 
ddd3775
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;'"]