-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (34 loc) · 1.03 KB
/
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
37
38
39
40
41
42
FROM ruby:2.5.5
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs imagemagick libimage-exiftool-perl zip unzip
# App
RUN mkdir -p /app
WORKDIR /app
ARG RAILS_ENV
ENV RAILS_ENV=$RAILS_ENV
# NodeJS
RUN mkdir -p /usr/local/nvm
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN node -v
RUN npm -v
# Yarn
# Install yarn via npm -_-
# See: https://rubyinrails.com/2019/03/29/dockerify-rails-6-application-setup/
COPY package.json yarn.lock ./
RUN npm install -g yarn
RUN yarn install --check-files --pure-lockfile
# Bundler
RUN gem install bundler -v 2.0.2
RUN gem install nokogiri -v 1.10.5 -- --use-system-libraries
COPY Gemfile Gemfile.lock ./
RUN bundle install --verbose --jobs 20 --retry 5 --deployment
# Setup
COPY . ./
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
# Run
ENTRYPOINT ["entrypoint.sh"]
CMD ["bundle", "exec", "foreman", "start"]