-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-cpu
More file actions
94 lines (68 loc) · 2.84 KB
/
Copy pathDockerfile-cpu
File metadata and controls
94 lines (68 loc) · 2.84 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
tzdata curl bash wget libstdc++6 nginx apache2-utils supervisor git python3-pip && \
pip install --upgrade pip
# Elasticsearch and Kibana Versions
ENV ES_VERSION=8.17.4
ENV KIBANA_VERSION=8.17.4
ENV ES_HOME=/opt/elasticsearch
ENV KIBANA_HOME=/opt/kibana
ENV JAVA_HOME=$ES_HOME/jdk
ENV PATH="$ES_HOME/bin:$KIBANA_HOME/bin:$PATH"
# Install Elasticsearch
RUN wget -q https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz \
&& tar -xzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz \
&& mv elasticsearch-${ES_VERSION} $ES_HOME \
&& rm elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
COPY ./elasticsearch.yml $ES_HOME/config/
# Install Kibana
RUN wget -q https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz \
&& tar -xzf kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz \
&& mv kibana-${KIBANA_VERSION} $KIBANA_HOME \
&& rm kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz
COPY ./kibana.yml $KIBANA_HOME/config/
# Create user to run Elasticsearch and Kibana
RUN useradd -m elasticsearch \
&& chown -R elasticsearch:elasticsearch $ES_HOME \
&& chown -R elasticsearch:elasticsearch $KIBANA_HOME \
&& chmod -R 777 $ES_HOME \
&& chmod -R 777 $KIBANA_HOME
# ------------------------
# Criar virtualenv separado só para o Langflow
# ------------------------
ENV LANGFLOW_VENV=/opt/langflow-venv
RUN python -m venv $LANGFLOW_VENV
# Ativar o venv para instalar o Langflow
RUN $LANGFLOW_VENV/bin/pip install --upgrade pip setuptools wheel && $LANGFLOW_VENV/bin/pip install langflow==1.5.0 langchain langchain-community langchain-ollama
COPY ./requirements* ./
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir streamlit==1.35.0
COPY ./NFeMiner/requirements* ./
RUN --mount=type=cache,target=/root/.cache pip install --ignore-installed -r requirements.gpu.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY --chmod=+x ./api ./api
COPY ./NFeMiner ./
RUN pip install /app
VOLUME ["/app/files"]
# Copy configs
COPY supervisord.conf ./
COPY nginx.conf /etc/nginx/nginx.conf
COPY .htpasswd /etc/nginx/.htpasswd
COPY streamlit /app/streamlit
RUN mkdir -p /app/files/log
COPY llm_processor.py ./
# Expose only nginx port
EXPOSE 80
EXPOSE 7862
# Environment variables used for service configuration. These can be modified by the client as needed via their docker-compose.yml file.
ENV KIBANA_HOST=localhost
ENV KIBANA_PORT=5601
ENV ELASTICSEARCH_HOST=localhost
ENV ELASTICSEARCH_PORT=9200
ENV LANGFLOW_HOST=localhost
ENV LANGFLOW_PORT=7862
# langflow tracking
ENV DO_NOT_TRACK=true
ENV TASKS_BASEPATH="tasks"
CMD ["/usr/bin/supervisord", "-c", "/app/supervisord.conf"]