File size: 839 Bytes
7470b0a
4af04ec
 
 
7470b0a
 
ec29e4c
7470b0a
 
ec29e4c
7470b0a
 
6f37e07
7470b0a
 
4af04ec
7470b0a
 
e1221d9
9f85b88
4af04ec
 
 
9f85b88
 
f8cad3c
9f85b88
4af04ec
4650839
4af04ec
9e390f2
ec29e4c
7470b0a
4af04ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.9-slim

WORKDIR /app

# Copy backend code
COPY backend /app/backend

# Copy backend utility modules (if any are outside /backend, add more COPY lines)
# (Not needed if all are in /backend)

# Copy frontend static files
COPY frontend /app/frontend

# Copy requirements
COPY backend/requirements.txt /app/requirements.txt

# Install dependencies
RUN pip install --no-cache-dir -r /app/requirements.txt

# Install nginx
# Install nginx
RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/*

# Copy minimal main nginx.conf
COPY nginx.main.conf /etc/nginx/nginx.conf

# Copy your site config
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Expose the port nginx will listen on
EXPOSE 7860

# Start FastAPI backend and nginx
CMD uvicorn backend.main:app --host 0.0.0.0 --port 8000 & nginx -g 'daemon off;'