-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerFile
More file actions
25 lines (18 loc) · 725 Bytes
/
Copy pathDockerFile
File metadata and controls
25 lines (18 loc) · 725 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
# Use the official Python image.
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 # Prevents Python from writing .pyc files to disk
ENV PYTHONUNBUFFERED=1 # Ensures that Python output is sent straight to terminal
# Set the working directory
WORKDIR /app
# Copy the requirements file and install dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . /app
# Download spaCy model during build
RUN python -m spacy download en_core_web_sm
# Expose the port the app runs on
EXPOSE 5000
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]