2025-02-01 12:52:26 -05:00
|
|
|
FROM ruby:3.3.4-slim
|
2024-03-15 18:31:06 -04:00
|
|
|
|
2024-09-17 18:53:29 -04:00
|
|
|
ENV APP_PATH=/var/app
|
2024-11-25 10:02:39 -05:00
|
|
|
ENV BUNDLE_VERSION=2.5.21
|
2024-09-17 18:53:29 -04:00
|
|
|
ENV BUNDLE_PATH=/usr/local/bundle/gems
|
|
|
|
|
ENV RAILS_LOG_TO_STDOUT=true
|
|
|
|
|
ENV RAILS_PORT=3000
|
2025-01-09 14:51:19 -05:00
|
|
|
ENV RAILS_ENV=development
|
2025-02-01 12:52:26 -05:00
|
|
|
ENV BUNDLE_FORCE_RUBY_PLATFORM=1
|
|
|
|
|
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1
|
2024-03-15 18:31:06 -04:00
|
|
|
|
|
|
|
|
# Install dependencies for application
|
2025-02-01 12:52:26 -05:00
|
|
|
RUN apt-get update -qq && apt-get install -y \
|
|
|
|
|
build-essential \
|
2024-03-15 18:31:06 -04:00
|
|
|
git \
|
2025-02-01 12:52:26 -05:00
|
|
|
libpq-dev \
|
2024-03-15 18:31:06 -04:00
|
|
|
postgresql-client \
|
2025-02-01 12:52:26 -05:00
|
|
|
libxml2 \
|
2024-03-15 18:31:06 -04:00
|
|
|
libxml2-dev \
|
2025-02-01 12:52:26 -05:00
|
|
|
libxslt1-dev \
|
2024-03-15 18:31:06 -04:00
|
|
|
nodejs \
|
2025-02-01 12:52:26 -05:00
|
|
|
npm \
|
2024-03-15 18:31:06 -04:00
|
|
|
imagemagick \
|
|
|
|
|
tzdata \
|
|
|
|
|
less \
|
2025-02-01 12:52:26 -05:00
|
|
|
libyaml-dev \
|
|
|
|
|
pkg-config \
|
|
|
|
|
&& npm install -g yarn \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2024-03-15 18:31:06 -04:00
|
|
|
&& mkdir -p $APP_PATH
|
|
|
|
|
|
2025-01-09 08:44:16 -05:00
|
|
|
# Update gem system and install bundler
|
|
|
|
|
RUN gem update --system 3.6.2 \
|
|
|
|
|
&& gem install bundler --version "$BUNDLE_VERSION" \
|
2024-03-15 18:31:06 -04:00
|
|
|
&& rm -rf $GEM_HOME/cache/*
|
|
|
|
|
|
|
|
|
|
WORKDIR $APP_PATH
|
|
|
|
|
|
2025-01-09 14:51:19 -05:00
|
|
|
COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./
|
2024-03-15 18:31:06 -04:00
|
|
|
|
2025-01-09 14:51:19 -05:00
|
|
|
# Install all gems into the image
|
2024-03-15 18:31:06 -04:00
|
|
|
RUN bundle config set --local path 'vendor/bundle' \
|
2025-02-01 12:52:26 -05:00
|
|
|
&& bundle install --jobs 1 --retry 3 \
|
2025-01-09 14:51:19 -05:00
|
|
|
&& rm -rf vendor/bundle/ruby/3.3.0/cache/*.gem
|
2024-03-15 18:31:06 -04:00
|
|
|
|
2025-01-09 14:51:19 -05:00
|
|
|
# Copy the rest of the application
|
2025-01-08 07:06:50 -05:00
|
|
|
COPY ../. ./
|
2024-03-15 18:31:06 -04:00
|
|
|
|
2024-09-17 18:53:29 -04:00
|
|
|
# Copy entrypoint scripts and grant execution permissions
|
2025-01-09 08:44:16 -05:00
|
|
|
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
|
|
|
|
|
RUN chmod +x /usr/local/bin/web-entrypoint.sh
|
|
|
|
|
|
|
|
|
|
COPY ./docker/sidekiq-entrypoint.sh /usr/local/bin/sidekiq-entrypoint.sh
|
|
|
|
|
RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh
|
2024-09-17 18:53:29 -04:00
|
|
|
|
2024-03-15 18:31:06 -04:00
|
|
|
EXPOSE $RAILS_PORT
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT [ "bundle", "exec" ]
|