forked from ragapp/ragapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (35 loc) · 1.13 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
37
38
39
40
41
42
43
44
45
46
47
48
# ======= FRONT-END BUILD ==========
FROM node:20-alpine as build
# Install make
RUN apk add --no-cache make
WORKDIR /app
COPY Makefile .
COPY admin ./admin
COPY patch/frontend ./patch/frontend
COPY patch/backend ./patch/backend
# Build static files for the Chat UI
RUN make build-frontends
# ======= RELEASE ==========
FROM python:3.11
WORKDIR /app
# Add create_llama/backend to PYTHONPATH
ENV PYTHONPATH=/app:/app/create_llama/backend
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Copy current code to the container
# and remove the frontend folder
COPY poetry.lock pyproject.toml ./
# Install dependencies
RUN poetry install --no-root --no-cache --only main
# Copy static files from the build stage
COPY --from=build /app/create_llama/frontend/out /app/static
COPY --from=build /app/admin/out /app/static/admin
COPY --from=build /app/create_llama/backend /app/create_llama/backend
COPY . .
# Create an empty data folder
RUN mkdir -p data
EXPOSE 8000
CMD ["python", "main.py"]