-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.prod
31 lines (23 loc) · 953 Bytes
/
Dockerfile.prod
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
# Base Ruby layer
FROM ruby:2.3.0
# Add system libraries layer
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs libleptonica-dev libtesseract-dev
# Create directory for tesseract and fetch training data
RUN mkdir /usr/local/share/tessdata
RUN curl -L https://github.com/danReynolds/ruby-tesseract-ocr/raw/master/eng.traineddata > /usr/local/share/tessdata/eng.traineddata
# Set the working directory to /app
RUN mkdir /app
WORKDIR /app
# Install all needed gems
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN gem install bundler && bundle install --without development test
# Copy the current directory contents into the container at /app
ADD . /app
# Precompile assets for production
RUN RAILS_ENV=production bundle exec rake assets:precompile --trace
# Set Rails environment mode to production
ENV RAILS_ENV production
ENV RACK_ENV production
# Start server
CMD ["rails","server","-b", "0.0.0.0"]