-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (21 loc) · 870 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
# docker build -t ror6dev --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) .
FROM ruby:2.7
ARG USER_ID
ARG GROUP_ID
RUN addgroup --gid $GROUP_ID user
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user
ENV INSTALL_PATH /opt/app
RUN mkdir -p $INSTALL_PATH
# Install Nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /root/yarn-pubkey.gpg && apt-key add /root/yarn-pubkey.gpg
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y --no-install-recommends nodejs yarn
RUN gem install rails bundler unicorn
COPY ./Gemfile Gemfile
RUN bundle install
# so they can run
RUN chown -R user:user /opt/app && chown -R user:user /usr/local/bundle
WORKDIR /opt/app
USER $USER_ID
#unicorn at tcp/8010
CMD bundle exec unicorn -c config/unicorn.rb