-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (26 loc) · 1.19 KB
/
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 an official Python runtime as a parent image
FROM python:3.11-slim-bookworm
# Set environment variables
# By setting PYTHONDONTWRITEBYTECODE to 1, it prevents Python from writing pyc files to disc (equivalent to python -B option)
ENV PYTHONDONTWRITEBYTECODE 1
# By setting PYTHONUNBUFFERED to 1, it disables the buffering of these streams, which means that the output will be immediately flushed to the console without any delay.
ENV PYTHONUNBUFFERED 1
# OpenAI API Key
ENV OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
# Langsmith API Key (optional, only if you want to use Langsmith's translation service)
ENV LANGCHAIN_TRACING_V2=true
ENV LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
ENV LANGCHAIN_API_KEY="<YOUR_LANGSMITH_API_KEY>"
ENV LANGCHAIN_PROJECT="<YOUR_LANGSMITH_PROJECT>"
# if not specified, defaults to "default"
# Set work directory in the container
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy the current directory contents into the container at /app
COPY . /app/
# Expose port
EXPOSE 8000
# Run the application:
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]