-
Notifications
You must be signed in to change notification settings - Fork 92
/
Dockerfile
40 lines (30 loc) · 989 Bytes
/
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
FROM ruby:3.2.2
WORKDIR /root
RUN apt-get update \
&& apt-get -y install tzdata git build-essential patch ruby-dev zlib1g-dev liblzma-dev default-jre sudo vim nano tmux \
libxkbcommon-dev libgbm-dev # Needed to run Chrome
# Container user and group
ARG USERNAME=lumen
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Create a user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
USER $USERNAME
# Use the latest bundler version
RUN sudo gem update --system
RUN gem update bundler
# Install and cache gems
WORKDIR /app
COPY Gemfile* /tmp/
WORKDIR /tmp
RUN bundle install
# To be able to create a .bash_history
WORKDIR /home/lumen/hist
RUN sudo chown -R $USERNAME:$USERNAME /home/lumen/hist
# Code mounted as a volume
WORKDIR /app
# Just to keep the containder running
CMD (while true; do sleep 1; done;)