-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 822 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 822 Bytes
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
27
28
29
30
31
32
# Use an official Python image with a smaller footprint
FROM python:3.9-slim
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
# Install Python dependencies from requirements.txt
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install huggingface_hub[hf_xet]
# Add application code to the Docker image
ADD . /app
# Set environment variables
ENV FLASK_ENV=production
# Set to "development" for development mode
ENV FLASK_APP=server.py
# Flask needs to know the entry point of the app
# Expose the Flask app's port
EXPOSE 5000
# Define the command to run the Flask server
CMD ["python3", "server.py"]