forked from brave-intl/publishers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (39 loc) · 1.39 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
43
44
45
46
47
48
49
50
51
52
FROM ruby:2.7-slim
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y nodejs \
libpq-dev \
git \
curl \
imagemagick \
libjemalloc2
RUN ["rm", "-rf", "/var/lib/apt/lists/*"]
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
SHELL [ "/bin/bash", "-l", "-c" ]
RUN curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
RUN gem install bundler
RUN NODE_ENV=production
RUN RAILS_ENV=production
WORKDIR /var/www/
# We are copying the Gemfile first, so we can install
# all the dependencies without any issues
# Rails will be installed once you load it from the Gemfile
# This will also ensure that gems are cached and only updated when they change.
COPY Gemfile ./
COPY Gemfile.lock ./
COPY package.json yarn.lock .nvmrc ./
# Install the dependencies.
RUN nvm install && nvm use
RUN bundle check || bundle install --jobs 20 --retry 5
RUN node --version
RUN npm install -g yarn
RUN yarn install --frozen-lockfile
# We copy all the files from the current directory to our
# /app directory
# Pay close attention to the dot (.)
# The first one will select ALL The files of the current directory,
# The second dot will copy it to the WORKDIR!
COPY . .
RUN bundle exec rails assets:precompile
EXPOSE 3000
ENTRYPOINT [ "./scripts/entrypoint.sh" ]
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb", "-e","${RACK_ENV:-development}"]