-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
39 lines (29 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
FROM ruby:3.2.3
LABEL org.opencontainers.image.source=https://github.com/skyderby/skyderby \
org.opencontainers.image.authors="Aleksandr Kunin <skyksandr@gmail.com>"
RUN apt-get update -qq && apt-get install -y -qq apt-transport-https ca-certificates \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& curl -sL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y -qq --no-install-recommends postgresql-client nodejs yarn libeccodes-dev \
&& rm -rf /var/lib/apt/lists/*
RUN echo "gem: --no-rdoc --no-ri" >> ~/.gemrc
ENV RAILS_ENV=production NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider
WORKDIR /tmp
COPY ./Gemfile Gemfile
COPY ./Gemfile.lock Gemfile.lock
RUN bundle config set --local without 'development test' && bundle install --jobs 20 --retry 5
WORKDIR /opt/app
COPY ./package.json package.json
COPY ./yarn.lock yarn.lock
RUN yarn install --production
RUN mkdir -p /opt/app \
&& mkdir -p /tmp/pids \
&& mkdir -p /tmp/sockets
COPY ./ /opt/app
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec i18n export
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile && rm -rf node_modules
VOLUME /opt/app/public/assets
VOLUME /opt/app/public/packs
VOLUME /opt/app/public
CMD rails db:migrate && bundle exec puma -C config/puma.rb