Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 779 B

You have to be logged in to leave a comment. Sign In
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
  1. # Use an official lightweight Python image.
  2. FROM python:3.9-slim
  3. # Set the working directory in the container
  4. WORKDIR /app
  5. # Install only the necessary packages.
  6. RUN pip install --no-cache-dir flask pandas numpy pymongo joblib scikit-learn mlflow onnxruntime dagshub apscheduler flask_cors requests
  7. # Create the expected directory structure as per your Flask app
  8. RUN mkdir -p src/serve
  9. RUN mkdir -p data/processed
  10. # Copy only the necessary files
  11. COPY src/serve/Predict_6.py src/serve/
  12. COPY data/processed/data_for_prediction.csv data/processed/
  13. # Set environment variables
  14. ENV FLASK_APP=src/serve/Predict_6.py
  15. ENV FLASK_RUN_HOST=0.0.0.0
  16. # Make port 5000 available to the world outside this container
  17. EXPOSE 5000
  18. # Run Flask when the container launches
  19. CMD ["flask", "run"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...