-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (25 loc) · 867 Bytes
/
Dockerfile
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
33
34
35
36
# Use a base Python image
FROM python:3.9.20-slim
# Set environment variables
ENV LANGCHAIN_TRACING_V2=true
ENV LANGCHAIN_PROJECT=YouTube-Echo
# Accept the LANGCHAIN_API_KEY as a build argument
ARG LANGCHAIN_API_KEY
# Set it as an environment variable
ENV LANGCHAIN_API_KEY=${LANGCHAIN_API_KEY}
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN pip install poetry
# Copy pyproject.toml and poetry.lock first (for caching)
COPY pyproject.toml poetry.lock ./
# Install Python dependencies with Poetry
RUN poetry install --only main
# Copy the entire project code
COPY . .
# Expose the port the app runs on
EXPOSE 5000
# Run the app using Gunicorn in production mode via Poetry
CMD ["poetry", "run", "gunicorn", "-b", "0.0.0.0:5000", "app:app"]