-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (23 loc) · 827 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
# Use the official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Create a non-root user
RUN adduser --disabled-password --gecos '' appuser
# Change the ownership of the database directory to appuser
RUN mkdir -p /app/data && chown -R appuser:appuser /app/data
# Switch to non-root user
# USER appuser
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV OPENAI_API_KEY=""
ENV OPENAI_BASE_URL="https://api.openai.com/v1"
# Make port 9999 available to the world outside this container
EXPOSE 9999
WORKDIR /app/app
# Run the application
ENTRYPOINT ["fastapi", "run", "main.py"]