2019-10-28 09:39:32 +01:00
|
|
|
FROM ruby:2.4
|
2017-11-10 17:02:07 +01:00
|
|
|
|
|
|
|
# Install dependencies
|
2019-10-28 09:39:32 +01:00
|
|
|
RUN deps='libmagic-dev chromium' && \
|
2017-11-10 17:02:07 +01:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install --no-install-recommends -y $deps && \
|
|
|
|
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*
|
|
|
|
|
|
|
|
ENV PORT=3000 \
|
|
|
|
SMTP_SERVER_PORT=2525 \
|
|
|
|
RAILS_ENV=development \
|
|
|
|
RAILS_LOG_TO_STDOUT=true \
|
|
|
|
RAILS_SERVE_STATIC_FILES=true \
|
|
|
|
\
|
2019-10-28 09:39:32 +01:00
|
|
|
CHROMIUM_FLAGS=--no-sandbox \
|
|
|
|
\
|
2017-11-10 17:02:07 +01:00
|
|
|
BUNDLE_PATH=/home/app/bundle \
|
|
|
|
BUNDLE_APP_CONFIG=/home/app/bundle/config
|
|
|
|
|
|
|
|
# Run app and all commands as user 'app'. This avoids changing permissions
|
|
|
|
# for files in mounted volume. Symlink for similarity with production image.
|
|
|
|
RUN adduser --gecos GECOS --disabled-password --shell /bin/bash app && \
|
|
|
|
ln -s /home/app/src /usr/src/app
|
|
|
|
USER app
|
|
|
|
|
|
|
|
WORKDIR /home/app/src
|
|
|
|
|
|
|
|
# Copy files needed for installing gem dependencies, and install them.
|
|
|
|
COPY Gemfile Gemfile.lock ./
|
|
|
|
COPY plugins ./plugins
|
|
|
|
RUN bundle config build.nokogiri "--use-system-libraries" && \
|
2019-10-29 11:49:10 +01:00
|
|
|
bundle install --frozen -j 4
|
2017-11-10 17:02:07 +01:00
|
|
|
|
|
|
|
# Copy the application code
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
# cleanup, and by default start web process from Procfile
|
|
|
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|
|
|
|
CMD ["./proc-start", "web"]
|