-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
36 lines (27 loc) · 895 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
FROM python:3.10-slim
ARG MODE=dev
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip && \
pip install poetry
# Copy only the necessary files for dependency installation
COPY pyproject.toml poetry.lock /app/
# Install project dependencies
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi --no-root
# Copy the rest of the application code
COPY . /app
EXPOSE 8000
# Set the command based on the build mode
CMD if [ "$MODE" = "dev" ]; then \
python -m chainlit run app.py -d --port 8000 --host 0.0.0.0 --watch; \
else \
python -m chainlit run app.py --port 8000 --host 0.0.0.0; \
fi