-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
131 lines (112 loc) · 2.82 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
FROM ruby:2.6-slim-buster
# Locales
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
# Better terminal support
ENV TERM screen-256color
ENV DEBIAN_FRONTEND noninteractive
# node
ENV NODE_MAJOR 12
# yarn
ENV YARN_VERSION 1.22.5
# Common packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
curl \
ctags \
fzf \
libevent-dev \
locales \
python3-dev \
python3-pip \
rubygems \
tidy \
tzdata \
zsh \
git \
software-properties-common \
ninja-build \
gettext \
libtool \
libtool-bin \
autoconf \
automake \
cmake \
g++ \
pkg-config \
unzip \
silversearcher-ag && \
locale-gen en_US.UTF-8 && \
chsh -s /usr/bin/zsh && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# build neovim
RUN git clone https://github.com/neovim/neovim.git /neovim && \
cd /neovim && \
make CMAKE_BUILD_TYPE=Release && \
make install && \
rm -rf /neovim
# RUN pip3 install --user neovim
RUN pip3 install pynvim sqlparse
# Add NodeJS to sources list
RUN curl -sL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash -
# Add Yarn to the sources list
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list
# Install dependencies
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \
apt-get install -yq --no-install-recommends \
nodejs \
yarn=$YARN_VERSION-1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log
RUN npm i -g \
eslint \
babel-eslint \
eslint-plugin-react \
prettier \
eslint-config-prettier \
eslint-plugin-prettier \
eslint-plugin-import \
stylelint \
eslint-config-airbnb \
eslint-plugin-jsx-a11y \
js-beautify \
remark-cli \
fixjson \
neovim
# Setup non root user
RUN groupadd -g 1000 vi
RUN useradd -m -d /home/vi -s /bin/bash -g vi -u 1000 vi
USER vi
# Install rubocop
RUN gem install \
ruby-beautify2 \
rubocop \
rubocop-performance \
rubocop-rails \
rubocop-rspec \
sass \
neovim
# TODO: fix ruby-beautify2
# https://github.com/jirutka/ruby-beautify2/issues/1
RUN rm -f /usr/local/bundle/gems/ruby-beautify2-0.98.0/bin/rbeautify && \
ln -s /usr/local/bundle/gems/ruby-beautify2-0.98.0/bin/ruby-rbeautify \
/usr/local/bundle/gems/ruby-beautify2-0.98.0/bin/rbeautify
# eslint config
COPY .eslintrc /home/vi/.eslintrc
# Add nvim config
RUN mkdir -p /home/vi/.config/nvim
RUN curl -fLo /home/vi/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
COPY init.vim \
plugins.vim \
settings.vim \
custom.vim \
ui.vim \
/home/vi/.config/nvim/
COPY .ctags /home/vi/
# Install neovim plugins
RUN nvim +PlugInstall +qall > /dev/null
# Set the workdir
WORKDIR /src