forked from slovensko-digital/navody.digital
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (25 loc) · 853 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
FROM ruby:3.2.1
# Install packages
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
build-essential \
libpq-dev \
nodejs \
yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
RUN mkdir /app
WORKDIR /app
# Bundle and cache Ruby gems
COPY Gemfile* ./
RUN bundle config set deployment true
RUN bundle config set without development:test
RUN bundle install
# Cache everything
COPY . .
RUN SECRET_KEY_BASE=NONE RAILS_ENV=production bundle exec rails assets:precompile
# Run application by default
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]