forked from TabbyML/tabby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (55 loc) · 1.92 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syntax = docker/dockerfile:1.5
FROM tabbyml/fastertransformer_backend
RUN apt update && apt -y install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
RUN mkdir -p /home/app
RUN chown 1000 /home/app
USER 1000
WORKDIR /home/app
ENV HOME /home/app
# Setup pyenv
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PATH="$HOME/.pyenv/shims:/home/app/.pyenv/bin:$PATH"
ARG PYTHON_VERSION=3.10.10
RUN pyenv install ${PYTHON_VERSION}
RUN pyenv global ${PYTHON_VERSION}
ARG PYPI_INDEX_URL=https://pypi.org/simple
ARG POETRY_VERSION=1.4.0
RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL "poetry==$POETRY_VERSION"
# vector
RUN <<EOF
curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | bash -s -- -y
EOF
ENV PATH "$HOME/.vector/bin:$PATH"
# Supervisord
RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL supervisor
RUN mkdir -p ~/.bin
ENV PATH "$HOME/.bin:$PATH"
# Install dagu
RUN <<EOF
curl -L https://github.com/yohamta/dagu/releases/download/v1.10.2/dagu_1.10.2_Linux_x86_64.tar.gz > dagu.tar.gz
tar zxvf dagu.tar.gz
mv dagu ~/.bin/
rm dagu.tar.gz LICENSE.md README.md
EOF
# Install tabby dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry export --without-hashes > requirements.txt
RUN --mount=type=cache,target=$HOME/.cache pip install -i $PYPI_INDEX_URL --no-dependencies -r requirements.txt
COPY tabby ./tabby
# Install caddy
RUN <<EOF
curl -L "https://github.com/caddyserver/caddy/releases/download/v2.6.4/caddy_2.6.4_linux_amd64.tar.gz" -o caddy.tar.gz
tar zxvf caddy.tar.gz
mv caddy ~/.bin/
rm caddy.tar.gz README.md LICENSE
EOF
# Setup file permissions
USER root
RUN mkdir -p /var/lib/vector
RUN chown 1000 /var/lib/vector
RUN mkdir -p $HOME/.cache
RUN chown 1000 $HOME/.cache
USER 1000
CMD ["./tabby/scripts/tabby.sh"]