-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (22 loc) · 841 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
FROM ruby:2.3.1
MAINTAINER Hirofumi Wakasugi <[email protected]>
RUN apt-get update && apt-get install -qq -y \
build-essential nodejs \
mecab libmecab-dev mecab-ipadic-utf8 \
--fix-missing --no-install-recommends
ENV APP_PATH /app
RUN mkdir $APP_PATH
WORKDIR $APP_PATH
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN bundle install --without developmet test --jobs 4 --retry 5 --deployment
ENV RAILS_ENV production
ENV RACK_ENV production
COPY . ./
RUN bin/rails assets:precompile
# Cannot execute rails db:migrate since the database does not exist while building an image
# RUN bin/rails db:migrate
RUN bin/rails index:get_keywords
# Cannot execute index:create rake task since the elasticsearch does not exist while building an image
# RUN bin/rails index:create
CMD bundle exec puma -C config/puma.rb