-
Notifications
You must be signed in to change notification settings - Fork 1
/
development.docker
42 lines (34 loc) · 1.19 KB
/
development.docker
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
FROM ruby:2.7.2
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
less \
nodejs \
npm \
postgresql-client-11 \
vim \
xauth \
xvfb \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g yarn
# Reasons for installing packages
# - less: better pager, for Pry in particular, but not only
# - nodejs: assets compilation
# - npm: yarn
# - postgresql-client-11: rails dbconsole
# - vim: rails secrets:edit, rails credentials:edit, bundle open, etc.
# - xauth and xvfb: headless browser testing
# - yarn: webpacker
RUN adduser --disabled-password --gecos '' app
USER app
COPY config/docker.vimrc ~/.vimrc
RUN bundle config set jobs $(nproc --ignore=1)
ENV EDITOR=vim DISPLAY=:0
# Setup the Solargraph LSP server for code autocompletion and navigation
RUN gem install solargraph && solargraph download-core
# For the "Go to definition" feature: make gems available on the host matchine
RUN bundle config set path vendor/bundle
# Allow running bundled gems executables without using `bundle exec`
ENV GEM_PATH=/app/vendor/bundle/ruby/2.7.0:/usr/local/lib/ruby/gems/2.7.0:/usr/local/bundle
ENV PATH=/app/vendor/bundle/ruby/2.7.0/bin:$PATH
WORKDIR /app
CMD ["bin/docker-spring"]