Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +37 -0
Dockerfile
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
# System dependencies required for Python packages
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
build-essential \
|
| 6 |
+
gcc \
|
| 7 |
+
curl \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Set working directory
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
|
| 13 |
+
# Install blis and googletrans separately to avoid building from source
|
| 14 |
+
RUN pip install --no-cache-dir --prefer-binary \
|
| 15 |
+
blis==0.7.9 \
|
| 16 |
+
googletrans==4.0.0rc1
|
| 17 |
+
|
| 18 |
+
# Copy requirements and install remaining dependencies
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Download spaCy model
|
| 23 |
+
RUN python -m spacy download en_core_web_sm
|
| 24 |
+
|
| 25 |
+
# Copy your application
|
| 26 |
+
COPY . .
|
| 27 |
+
|
| 28 |
+
# Expose required port
|
| 29 |
+
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
# Flask environment config
|
| 32 |
+
ENV FLASK_APP=app.py
|
| 33 |
+
ENV FLASK_RUN_PORT=7860
|
| 34 |
+
ENV FLASK_RUN_HOST=0.0.0.0
|
| 35 |
+
|
| 36 |
+
# Run the Flask server
|
| 37 |
+
CMD ["flask", "run"]
|