-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
85 lines (69 loc) · 2.18 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
74
75
76
77
78
79
80
81
82
83
84
FROM alpine:3.14 as tools
RUN apk add --no-cache \
git \
build-base \
cmake \
automake \
autoconf \
libtool \
pkgconf \
coreutils \
curl \
unzip \
gettext-tiny-dev \
musl-dev
WORKDIR /tools
RUN \
# build neovim
cd /tools \
&& git clone https://github.com/neovim/neovim.git \
&& cd neovim \
&& make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=/tools/nvim install \
# fetch plugin manager for neovim
&& cd /tools \
&& curl -fLo /tools/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \
# build fzf-native for telescope
&& cd /tools \
&& git clone https://github.com/nvim-telescope/telescope-fzf-native.nvim.git \
&& cd telescope-fzf-native.nvim \
&& make
FROM alpine:3.14
ARG COPILOT_TOKEN="override me"
ARG INTELEPHENSE_KEY="override me"
ENV RIPGREP_CONFIG_PATH "/home/neovim/.config/ripgrep/config"
RUN apk add --no-cache \
# needed by neovim as provider
python3-dev py-pip musl-dev g++ curl \
nodejs yarn \
# needed by telescope
ripgrep git \
# needed by lsp
&& yarn global add intelephense --prefix /usr/local
# add neovim
COPY --from=tools /tools/nvim /nvim
RUN ln -s /nvim/bin/nvim /usr/bin/nvim
# add user
RUN adduser -D neovim
USER neovim
# add neovim config
COPY --chown=neovim:neovim config /home/neovim/.config
# add vim-plug
COPY --chown=neovim:neovim --from=tools /tools/plug.vim /home/neovim/.config/nvim/autoload/
# add fzf-native
COPY --chown=neovim:neovim --from=tools /tools/telescope-fzf-native.nvim/build/libfzf.so /home/neovim/
RUN \
# install python's neovim plugin
pip install pynvim \
# install node's neovim plugin
&& yarn global add neovim \
# install neovim plugins
&& nvim --headless +PlugInstall +qall \
# install treesitter languages
&& nvim --headless +"TSInstallSync php yaml json css scss html javascript" +q \
# insert copilot beta key
&& sed -i "s/<TOKEN>/$COPILOT_TOKEN/" /home/neovim/.config/github-copilot/hosts.json \
# insert intelephense key
&& mkdir ~/intelephense \
&& echo "$INTELEPHENSE_KEY" > ~/intelephense/licence.txt
WORKDIR /data
ENTRYPOINT [ "nvim", "."]