Commit
·
ccd6e6d
1
Parent(s):
8753236
deploy
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -9,7 +9,7 @@ ENV TRANSFORMERS_CACHE="/app/cache"
|
|
| 9 |
RUN mkdir -p /app/cache
|
| 10 |
|
| 11 |
# Install required Python packages
|
| 12 |
-
RUN pip install --no-cache-dir sentence-transformers
|
| 13 |
|
| 14 |
# Pre-download the model during the image build process
|
| 15 |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/clip-ViT-B-32-multilingual-v1')"
|
|
@@ -20,8 +20,8 @@ WORKDIR /app
|
|
| 20 |
# Copy application code
|
| 21 |
COPY . /app
|
| 22 |
|
| 23 |
-
# Expose port
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 9 |
RUN mkdir -p /app/cache
|
| 10 |
|
| 11 |
# Install required Python packages
|
| 12 |
+
RUN pip install --no-cache-dir uvicorn fastapi sentence-transformers
|
| 13 |
|
| 14 |
# Pre-download the model during the image build process
|
| 15 |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/clip-ViT-B-32-multilingual-v1')"
|
|
|
|
| 20 |
# Copy application code
|
| 21 |
COPY . /app
|
| 22 |
|
| 23 |
+
# Expose port for FastAPI
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# Ensure the CMD is executed in the correct way
|
| 27 |
+
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|