diff --git a/Dockerfile.app b/Dockerfile.app index f2a5b8d0..0691d9d3 100644 --- a/Dockerfile.app +++ b/Dockerfile.app @@ -1,5 +1,3 @@ -# Dockerfile - # Use Python 3.10 slim version FROM python:3.10-slim @@ -11,10 +9,15 @@ RUN pip install -r requirements.txt # Copy the application into the /web_service folder COPY ./src/web_service /web_service -# Expose the correct ports (8001 for the API, 4201 if you want perfect Prefect) -EXPOSE 8001 +# Copy the run_services.sh script into the /bin folder +COPY ./bin/run_services.sh /bin/run_services.sh + +# Expose the correct ports (8001 for the API, 4201 for Prefect) +EXPOSE 8001 4200 + -# Set the working directory to /web_service -WORKDIR /web_service +# Make the run_services.sh script executable +RUN chmod +x /bin/run_services.sh -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] +# Command to run the script +CMD ["/bin/run_services.sh"] diff --git a/bin/run_services.sh b/bin/run_services.sh index 639eeb28..f49a67cb 100755 --- a/bin/run_services.sh +++ b/bin/run_services.sh @@ -6,7 +6,7 @@ sqlite3 --version prefect server start --host 0.0.0.0 & # Go in the good directory -cd ../src/web_service +cd src/web_service # Start FastAPI with Uvicorn uvicorn main:app --reload --port 8001