File size: 1,251 Bytes
99bbd9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
FROM python:3.12-slim-bookworm

WORKDIR /app

# Install system dependencies for aws 
# RUN apt-get update && apt-get install -y --no-install-recommends \
#     libpq-dev \
#     gcc \
#     g++ \
#     nginx \
#     && rm -rf /var/lib/apt/lists/*

# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire application
COPY . /app

# Nginx configuration
# RUN echo " \
#     server { \
#         listen 80; \
#         server_name localhost; \
#         location / { \
#             proxy_pass http://localhost:8501; \
#             proxy_set_header Host \$host; \
#             proxy_set_header X-Real-IP \$remote_addr; \
#             proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
#             proxy_set_header X-Forwarded-Proto \$scheme; \
#         } \
#     }" > /etc/nginx/conf.d/default.conf

# Expose the ports
# EXPOSE 8000 8501 80
# EXPOSE 8000 

# Start Nginx and then the backend and frontend
# CMD service nginx start && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload & streamlit run app/frontend/Talk2SQL.py --server.address=0.0.0.0 --server.port=8501
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]