-
Notifications
You must be signed in to change notification settings - Fork 0
/
EventProcessorDockerfile
76 lines (56 loc) · 1.96 KB
/
EventProcessorDockerfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM python:3.11-alpine AS base
ARG DEV=false
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
RUN apk update && \
apk add libpq
FROM base AS builder
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
RUN apk update && \
apk add linux-headers build-base python3-dev ethtool && \
apk add musl-dev gcc gfortran openblas-dev libffi-dev g++
# RUN apk update apk add libffi-dev
WORKDIR /app
# Install Poetry
RUN pip install poetry==1.8.0
# Install the app
COPY pyproject.toml ./
RUN poetry update
RUN pip install gpt4all
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR;
FROM base AS runtime
WORKDIR /app
RUN apk update && \
apk add gcc musl-dev gfortran openblas-dev libffi-dev g++
RUN pip install poetry==1.8.0
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
RUN mkdir -p /app/processor
RUN mkdir -p /app/library
RUN mkdir -p /app/library/data
RUN mkdir -p /app/library/data/local
RUN mkdir -p /app/library/data/external
RUN mkdir -p /app/library/enums
RUN mkdir -p /app/library/llms
RUN mkdir -p /app/library/managers
RUN mkdir -p /app/library/models
RUN mkdir -p /app/resources
RUN mkdir -p /app/prompts
COPY pyproject.toml ./
RUN poetry lock --no-update
RUN poetry install
COPY globals.py ./
COPY processor/events.py processor/context.py ./processor/
COPY library/data/local/vdb.py library/data/local/weaviate.py library/data/local/neo4j.py ./library/data/local/
COPY library/data/external/slack.py ./library/data/external/
COPY library/managers/* ./library/managers
COPY library/llms/promptmanager.py library/llms/groq_client.py ./library/llms/
COPY library/utils.py library/token_generator.py library/document_parser.py library/decorators.py ./library/
COPY resources/slack_users.json ./resources/
COPY prompts/* ./prompts
COPY library/enums/*.py ./library/enums/
COPY library/models/*.py ./library/models/
RUN ls -la
CMD ["poetry", "run", "event_processor"]