forked from bestwebua/Railway-oriented-Rails-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (21 loc) · 746 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
FROM ruby:2.6.5-alpine
RUN apk add bash git openssh httpie libxml2-dev libxslt-dev postgresql-dev \
tzdata npm nodejs imagemagick make cmake g++ postgresql-client less
RUN npm install -g snowboard
ENV APP_USER app
ENV APP_USER_HOME /home/$APP_USER
ENV APP_HOME /home/www/boilerplate_rails_api
RUN adduser -D -h $APP_USER_HOME $APP_USER
RUN mkdir /var/www && \
chown -R $APP_USER:$APP_USER /var/www && \
chown -R $APP_USER $APP_USER_HOME
WORKDIR $APP_HOME
USER $APP_USER
COPY Gemfile Gemfile.lock .ruby-version ./
RUN gem i bundler -v $(tail -1 Gemfile.lock | tr -d ' ')
RUN bundle check || bundle install
COPY . .
USER root
RUN chown -R $APP_USER:$APP_USER "$APP_HOME/."
USER $APP_USER
CMD bundle exec puma -C config/puma.rb