2024-07-18 17:12:31 +03:00
|
|
|
ARG RUBY_VERSION=3.3
|
|
|
|
FROM ruby:${RUBY_VERSION} AS base
|
2020-07-16 20:18:00 +03:00
|
|
|
|
2018-04-25 19:44:21 -05:00
|
|
|
WORKDIR /app
|
2020-07-19 21:30:24 +03:00
|
|
|
RUN touch /etc/app-env
|
|
|
|
|
2020-08-25 21:46:27 +03:00
|
|
|
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
|
2024-06-06 10:55:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y yarn netcat-openbsd
|
2024-07-18 17:12:31 +03:00
|
|
|
RUN gem install bundler
|
2020-08-25 21:46:27 +03:00
|
|
|
|
2018-04-25 19:44:21 -05:00
|
|
|
RUN mkdir /app/log
|
|
|
|
|
2022-02-09 11:28:05 +02:00
|
|
|
COPY COPYING /app/
|
|
|
|
COPY config /app/config/
|
2020-07-16 20:18:00 +03:00
|
|
|
COPY config/database.docker.yml /app/config/database.yml
|
|
|
|
COPY config/site.docker.yml /app/config/site.yml
|
|
|
|
|
2022-02-09 11:28:05 +02:00
|
|
|
COPY bin /app/bin/
|
|
|
|
COPY script /app/script/
|
|
|
|
COPY public /app/public/
|
|
|
|
COPY vendor /app/vendor/
|
|
|
|
|
|
|
|
COPY .yardopts /app/
|
|
|
|
COPY Rakefile /app/
|
|
|
|
COPY config.ru /app/
|
|
|
|
COPY docker-entrypoint.sh /app/
|
|
|
|
|
|
|
|
COPY lib /app/lib/
|
|
|
|
COPY app /app/app/
|
|
|
|
COPY db /app/db/
|
|
|
|
|
2024-07-18 22:09:35 +03:00
|
|
|
# Use glob to omit error if the .git directory doesn't exists (in case the
|
|
|
|
# code is from a release archive, not a Git clone)
|
|
|
|
COPY .gi[t] /app/.git
|
2022-02-21 12:32:08 +02:00
|
|
|
|
2024-07-18 17:12:31 +03:00
|
|
|
COPY Gemfile* /app/
|
2020-07-19 16:12:57 +03:00
|
|
|
|
2020-07-19 21:30:24 +03:00
|
|
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
2018-04-25 19:44:21 -05:00
|
|
|
EXPOSE 3000
|
2021-11-29 21:37:44 +02:00
|
|
|
CMD ["./bin/rails", "server", "-b", "0.0.0.0"]
|
2024-07-18 17:12:31 +03:00
|
|
|
|
|
|
|
FROM base AS precompile
|
|
|
|
RUN bundle config set with assets
|
|
|
|
RUN bundle config set deployment true
|
|
|
|
RUN bundle install --jobs 4
|
|
|
|
RUN RAILS_GROUPS=assets bundle exec rake assets:precompile
|
|
|
|
|
|
|
|
# Build the environment-specific stuff
|
|
|
|
FROM base AS production
|
|
|
|
RUN bundle config --global frozen 1
|
|
|
|
RUN bundle install --jobs 4
|
|
|
|
COPY --from=precompile /app/public/assets /app/public/assets
|
|
|
|
|
|
|
|
FROM base AS test
|
|
|
|
COPY test /app/test/
|
|
|
|
# For testing the API client
|
|
|
|
COPY doc /app/doc/
|
|
|
|
RUN bundle config set with development test assets
|
|
|
|
RUN bundle config --global frozen 1
|
|
|
|
RUN bundle install --jobs 4
|
|
|
|
RUN RAILS_GROUPS=assets bundle exec rake assets:precompile
|
|
|
|
|
|
|
|
FROM base AS development
|
|
|
|
RUN bundle config set with development test
|
|
|
|
RUN bundle install --jobs 4
|