-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (23 loc) · 848 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
# Use the official Python image from the Docker Hub
FROM python:3.11
# Create a new user with a specific UID and set it as the default user
RUN useradd -m -u 1000 user
# Switch to the new user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory
WORKDIR $HOME/app
# Copy the requirements file and install the dependencies
COPY --chown=user ./requirements.txt $HOME/app/requirements.txt
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Copy project files to the working directory
COPY --chown=user . $HOME/app
# Set PYTHONPATH to include the project directory
ENV PYTHONPATH=$HOME/app
# Initialize the database
RUN python smartquery/init_db.py
# Set the command to run the application
CMD ["chainlit", "run", "smartquery/app.py", "--port", "7860"]