forked from appdev-projects/rps-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
106 lines (90 loc) · 3.7 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
FROM buildpack-deps:focal
### base ###
RUN yes | unminimize \
&& apt-get install -yq \
zip \
unzip \
bash-completion \
build-essential \
htop \
jq \
less \
locales \
man-db \
nano \
software-properties-common \
sudo \
time \
vim \
multitail \
lsof \
&& locale-gen en_US.UTF-8 \
&& mkdir /var/lib/apt/dazzle-marks \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
ENV LANG=en_US.UTF-8
### Git ###
RUN add-apt-repository -y ppa:git-core/ppa \
&& apt-get install -yq git \
&& rm -rf /var/lib/apt/lists/*
### Gitpod user ###
# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
# passwordless sudo for users in the 'sudo' group
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers
ENV HOME=/home/gitpod
WORKDIR $HOME
# custom Bash prompt
RUN { echo && echo "PS1='\[\e]0;\u \w\a\]\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \\\$ '" ; } >> .bashrc
### Gitpod user (2) ###
USER gitpod
# use sudo so that user does not get sudo usage info on (the first) login
RUN sudo echo "Running 'sudo' for Gitpod: success" && \
# create .bashrc.d folder and source it in the bashrc
mkdir /home/gitpod/.bashrc.d && \
(echo; echo "for i in \$(ls \$HOME/.bashrc.d/*); do source \$i; done"; echo) >> /home/gitpod/.bashrc
### Ruby ###
LABEL dazzle/layer=lang-ruby
LABEL dazzle/test=tests/lang-ruby.yaml
USER gitpod
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \
&& curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - \
&& curl -fsSL https://get.rvm.io | bash -s stable \
&& bash -lc " \
rvm requirements \
&& rvm install 2.7.3 \
&& rvm use 2.7.3 --default \
&& rvm rubygems current \
&& gem install bundler --no-document \
&& gem install solargraph --no-document" \
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> /home/gitpod/.bashrc.d/70-ruby
RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc
USER gitpod
# AppDev stuff
WORKDIR /base-rails
# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN sudo apt-get -y update
RUN sudo apt-get -y install google-chrome-stable
# Install Chromedriver
RUN sudo apt-get -y install google-chrome-stable
RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip
RUN sudo mv chromedriver /usr/bin/chromedriver
RUN sudo chown root:root /usr/bin/chromedriver
RUN sudo chmod +x /usr/bin/chromedriver
COPY Gemfile /base-rails/Gemfile
COPY --chown=gitpod:gitpod Gemfile.lock /base-rails/Gemfile.lock
RUN /bin/bash -l -c "gem install bundler:2.1.4"
USER gitpod
RUN /bin/bash -l -c "bundle install"
RUN /bin/bash -l -c "curl https://cli-assets.heroku.com/install.sh | sh"
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN sudo apt-get update && sudo apt-get install -y nodejs yarn
# postgresql-client
# RUN sudo apt-get update && sudo apt-get install -y yarn
RUN sudo apt install -y postgresql postgresql-contrib libpq-dev psmisc lsof expect
USER gitpod
RUN echo "rvm use 2.7.3" >> ~/.bashrc
RUN echo "rvm_silence_path_mismatch_check_flag=1" >> ~/.rvmrc