forked from Josh-XT/AGiXT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (41 loc) · 1.38 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
# Use Python 3.10
ARG BASE_IMAGE="python:3.10-bullseye"
FROM ${BASE_IMAGE}
# Install system packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update ; \
apt-get upgrade -y ; \
apt-get install -y --no-install-recommends git build-essential g++ libgomp1 ffmpeg python3 python3-pip python3-dev curl postgresql-client && \
rm -rf /var/lib/apt/lists/*
# Update pip
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
pip install -U pip setuptools
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PLAYWRIGHT_BROWSERS_PATH=0 \
PATH="/usr/local/bin:$PATH" \
LD_PRELOAD=libgomp.so.1 \
UVICORN_WORKERS=6
# Set work directory
WORKDIR /
# Copy only static-requirements, to cache them in docker layer
COPY static-requirements.txt .
# Install static dependencies
RUN pip install -r static-requirements.txt
# Copy only requirements, to cache them in docker layer
COPY requirements.txt .
# Install application dependencies
ARG HNSWLIB_NO_NATIVE=1
RUN pip install -r requirements.txt
RUN pip install --force-reinstall hnswlib protobuf==3.20.*
# Install Node.js
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
# Install Playwright
RUN npm install -g playwright
RUN npx playwright install
COPY . .
RUN chmod +x /agixt/launch-backend.sh
WORKDIR /agixt
CMD ./launch-backend.sh