generated from rootstrap/rails_api_base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (24 loc) · 858 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:3.1.2
RUN apt-get update -qq && \
apt-get install -y build-essential libssl-dev nodejs libpq-dev less vim nano libsasl2-dev
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt install yarn
ENV WORK_ROOT /src
ENV APP_HOME $WORK_ROOT/myapp/
ENV LANG C.UTF-8
ENV GEM_HOME $WORK_ROOT/bundle
ENV BUNDLE_BIN $GEM_HOME/gems/bin
ENV PATH $GEM_HOME/bin:$BUNDLE_BIN:$PATH
RUN gem install bundler
RUN mkdir -p $APP_HOME
RUN bundle config --path=$GEM_HOME
WORKDIR $APP_HOME
ADD Gemfile ./
ADD Gemfile.lock ./
RUN bundle install
ADD package.json yarn.lock ./
RUN yarn install --check-files
ADD . $APP_HOME
EXPOSE 3000
ENTRYPOINT bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -b 0.0.0.0 -p 3000"