-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 931 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
34
35
36
37
FROM ruby:2.7.5
ENV RAILS_ENV=production \
SECRET_KEY_BASE=dummy
WORKDIR /app
# Install NodeJS
RUN --mount=type=cache,target=/var/cache/apt \
curl https://deb.nodesource.com/setup_16.x | bash && \
apt install -y nodejs && \
apt update && \
npm install -g [email protected] && \
npm install --global yarn && \
apt install -y libicu-dev postgresql-client && \
gem install bundler:2.2.17 && \
rm -rf /var/lib/apt/lists/*
COPY Gemfile* ./
RUN bundle config set --local without 'development test' && bundle install
COPY package* ./
COPY yarn.lock .
COPY packages packages
RUN yarn install
COPY . .
RUN bundle exec bootsnap precompile --gemfile app/ lib/ config/ bin/ db/ && bundle exec rake assets:precompile
# Configure endpoint.
COPY ./entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]