Update Dockerfile
Browse files- Dockerfile +14 -14
Dockerfile
CHANGED
|
@@ -1,25 +1,22 @@
|
|
| 1 |
-
# Use Python 3.10 as
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
WORKDIR /app/src
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
COPY . .
|
| 18 |
-
|
| 19 |
-
# Expose ports for FastAPI and Streamlit apps
|
| 20 |
EXPOSE 8000 8501
|
| 21 |
|
| 22 |
-
# Create
|
| 23 |
RUN echo '#!/bin/bash\n\
|
| 24 |
python response_api.py &\n\
|
| 25 |
sleep 5\n\
|
|
@@ -28,5 +25,8 @@ streamlit run app.py' > ./start.sh
|
|
| 28 |
# Make the script executable
|
| 29 |
RUN chmod +x ./start.sh
|
| 30 |
|
| 31 |
-
#
|
|
|
|
|
|
|
|
|
|
| 32 |
CMD ["./start.sh"]
|
|
|
|
| 1 |
+
# Use Python 3.10 as base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set working directory in container
|
| 5 |
WORKDIR /app/src
|
| 6 |
|
| 7 |
+
# Copy requirements file
|
| 8 |
+
COPY src/requirements.txt .
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy the entire project
|
| 14 |
+
COPY src .
|
| 15 |
|
| 16 |
+
# Expose ports for API and Streamlit
|
|
|
|
|
|
|
|
|
|
| 17 |
EXPOSE 8000 8501
|
| 18 |
|
| 19 |
+
# Create script to run both services
|
| 20 |
RUN echo '#!/bin/bash\n\
|
| 21 |
python response_api.py &\n\
|
| 22 |
sleep 5\n\
|
|
|
|
| 25 |
# Make the script executable
|
| 26 |
RUN chmod +x ./start.sh
|
| 27 |
|
| 28 |
+
# Copy .env file and set environment variables
|
| 29 |
+
ENV $(cat .env | xargs)
|
| 30 |
+
|
| 31 |
+
# Run the start script
|
| 32 |
CMD ["./start.sh"]
|