pratham0011
commited on
Commit
•
d72b836
1
Parent(s):
4d9e4cb
Update Dockerfile
Browse files- Dockerfile +37 -37
Dockerfile
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
# ... existing Dockerfile content ...
|
2 |
-
|
3 |
-
# Use an official Python runtime as a parent image
|
4 |
-
FROM python:3.12
|
5 |
-
|
6 |
-
# Set the working directory in the container
|
7 |
-
WORKDIR /app
|
8 |
-
|
9 |
-
# Copy the current directory contents into the container at /app
|
10 |
-
COPY . /app
|
11 |
-
|
12 |
-
# Install system dependencies
|
13 |
-
RUN apt-get update && apt-get install -y \
|
14 |
-
build-essential \
|
15 |
-
curl \
|
16 |
-
software-properties-common \
|
17 |
-
&& rm -rf /var/lib/apt/lists/*
|
18 |
-
|
19 |
-
# Install Python dependencies
|
20 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
-
|
22 |
-
# Create the data and db directories with appropriate permissions
|
23 |
-
RUN mkdir -p data db && chmod 777 data db
|
24 |
-
|
25 |
-
# Make port 8000 available for FastAPI and port 7860 for Streamlit
|
26 |
-
EXPOSE
|
27 |
-
EXPOSE
|
28 |
-
|
29 |
-
# Create a script to run both FastAPI and Streamlit
|
30 |
-
RUN echo '#!/bin/bash\n\
|
31 |
-
uvicorn main:app --host 0.0.0.0 --port 8000 &\n\
|
32 |
-
streamlit run streamlit_app.py --server.port 7860 --server.address 0.0.0.0 --server.enableCORS false\n\
|
33 |
-
' > /app/run.sh
|
34 |
-
|
35 |
-
RUN chmod +x /app/run.sh
|
36 |
-
|
37 |
-
# Run the script when the container launches
|
38 |
CMD ["/app/run.sh"]
|
|
|
1 |
+
# ... existing Dockerfile content ...
|
2 |
+
|
3 |
+
# Use an official Python runtime as a parent image
|
4 |
+
FROM python:3.12
|
5 |
+
|
6 |
+
# Set the working directory in the container
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
# Copy the current directory contents into the container at /app
|
10 |
+
COPY . /app
|
11 |
+
|
12 |
+
# Install system dependencies
|
13 |
+
RUN apt-get update && apt-get install -y \
|
14 |
+
build-essential \
|
15 |
+
curl \
|
16 |
+
software-properties-common \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
+
|
19 |
+
# Install Python dependencies
|
20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
+
|
22 |
+
# Create the data and db directories with appropriate permissions
|
23 |
+
RUN mkdir -p data db && chmod 777 data db
|
24 |
+
|
25 |
+
# Make port 8000 available for FastAPI and port 7860 for Streamlit
|
26 |
+
EXPOSE 7860
|
27 |
+
EXPOSE 8000
|
28 |
+
|
29 |
+
# Create a script to run both FastAPI and Streamlit
|
30 |
+
RUN echo '#!/bin/bash\n\
|
31 |
+
uvicorn main:app --host 0.0.0.0 --port 8000 &\n\
|
32 |
+
streamlit run streamlit_app.py --server.port 7860 --server.address 0.0.0.0 --server.enableCORS false\n\
|
33 |
+
' > /app/run.sh
|
34 |
+
|
35 |
+
RUN chmod +x /app/run.sh
|
36 |
+
|
37 |
+
# Run the script when the container launches
|
38 |
CMD ["/app/run.sh"]
|