forked from assafelovic/gpt-researcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (35 loc) · 1.35 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
49
50
FROM python:3.11.4-slim-bullseye AS install-browser
RUN apt-get update \
&& apt-get satisfy -y \
"chromium, chromium-driver (>= 115.0)" \
&& chromium --version && chromedriver --version
RUN apt-get update \
&& apt-get install -y --fix-missing firefox-esr wget \
&& wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz \
&& tar -xvzf geckodriver* \
&& chmod +x geckodriver \
&& mv geckodriver /usr/local/bin/
# Install build tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
FROM install-browser AS gpt-researcher-install
ENV PIP_ROOT_USER_ACTION=ignore
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY ./requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
COPY ./multi_agents/requirements.txt ./multi_agents/requirements.txt
RUN pip install -r multi_agents/requirements.txt
FROM gpt-researcher-install AS gpt-researcher
ARG OPENAI_API_KEY
ARG TAVILY_API_KEY
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV TAVILY_API_KEY=${TAVILY_API_KEY}
RUN useradd -ms /bin/bash gpt-researcher \
&& chown -R gpt-researcher:gpt-researcher /usr/src/app
USER gpt-researcher
COPY --chown=gpt-researcher:gpt-researcher ./ ./
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]