pratham0011
commited on
Create docker
Browse files
docker
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.12
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
# Install system dependencies
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
build-essential \
|
13 |
+
curl \
|
14 |
+
software-properties-common \
|
15 |
+
&& rm -rf /var/lib/apt/lists/*
|
16 |
+
|
17 |
+
# Install Python dependencies
|
18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
+
|
20 |
+
# Make port 7860 available to the world outside this container
|
21 |
+
EXPOSE 7860
|
22 |
+
|
23 |
+
# Create a script to run both FastAPI and Streamlit
|
24 |
+
RUN echo '#!/bin/bash\n\
|
25 |
+
uvicorn main:app --host 0.0.0.0 --port 8000 &\n\
|
26 |
+
streamlit run streamlit_app.py --server.port 7860 --server.address 0.0.0.0\n\
|
27 |
+
' > /app/run.sh
|
28 |
+
|
29 |
+
RUN chmod +x /app/run.sh
|
30 |
+
|
31 |
+
# Run the script when the container launches
|
32 |
+
CMD ["/app/run.sh"]
|