Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official PyTorch image as a base (includes CUDA for GPU support if available)
|
| 2 |
+
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
|
| 3 |
+
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install Python dependencies
|
| 8 |
+
RUN pip install --no-cache-dir \
|
| 9 |
+
pandas \
|
| 10 |
+
torch \
|
| 11 |
+
sentence-transformers \
|
| 12 |
+
transformers \
|
| 13 |
+
numpy \
|
| 14 |
+
faiss-cpu \
|
| 15 |
+
gunicorn \
|
| 16 |
+
huggingface_hub
|
| 17 |
+
|
| 18 |
+
# Copy the necessary files into the container
|
| 19 |
+
COPY plant_data_chunks_and_embeddings.csv /app/plant_data_chunks_and_embeddings.csv
|
| 20 |
+
COPY main.py /app/main.py
|
| 21 |
+
|
| 22 |
+
# Set the environment variable to point to the app directory
|
| 23 |
+
ENV PYTHONPATH /app
|
| 24 |
+
|
| 25 |
+
# Expose the port the app will run on (useful when you run the app in the container)
|
| 26 |
+
EXPOSE 5000
|
| 27 |
+
|
| 28 |
+
# Command to run the app (Gunicorn is a WSGI server that serves the Flask app)
|
| 29 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "main:app"]
|