Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -1,34 +1,37 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
build-essential \
|
| 6 |
gcc \
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
# Set working directory
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
# Install blis separately to avoid
|
| 13 |
-
RUN pip install --no-cache-dir
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
# Copy requirements and install
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 18 |
|
| 19 |
-
#
|
| 20 |
RUN python -m spacy download en_core_web_sm
|
| 21 |
|
| 22 |
-
# Copy
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
# Expose
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
-
#
|
| 29 |
ENV FLASK_APP=app.py
|
| 30 |
ENV FLASK_RUN_PORT=7860
|
| 31 |
ENV FLASK_RUN_HOST=0.0.0.0
|
| 32 |
|
| 33 |
-
# Run the Flask
|
| 34 |
CMD ["flask", "run"]
|
|
|
|
| 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"]
|