2025-02-06 12:06:03 -05:00
|
|
|
FROM ruby:3.4.1-alpine
|
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-04-13 17:30:57 -04:00
|
|
|
ENV SELF_HOSTED=true
|
2025-05-02 14:38:57 -04:00
|
|
|
ENV SIDEKIQ_USERNAME=sidekiq
|
|
|
|
|
ENV SIDEKIQ_PASSWORD=password
|
2024-03-15 18:31:06 -04:00
|
|
|
|
|
|
|
|
# Install dependencies for application
|
2025-02-06 12:06:03 -05:00
|
|
|
RUN apk -U add --no-cache \
|
|
|
|
|
build-base \
|
2024-03-15 18:31:06 -04:00
|
|
|
git \
|
2025-02-06 12:06:03 -05:00
|
|
|
postgresql-dev \
|
|
|
|
|
postgresql-client \
|
2024-03-15 18:31:06 -04:00
|
|
|
libxml2-dev \
|
2025-02-01 13:49:57 -05:00
|
|
|
libxslt-dev \
|
2024-03-15 18:31:06 -04:00
|
|
|
nodejs \
|
2025-02-06 12:06:03 -05:00
|
|
|
yarn \
|
2024-03-15 18:31:06 -04:00
|
|
|
imagemagick \
|
|
|
|
|
tzdata \
|
|
|
|
|
less \
|
2025-02-06 12:06:03 -05:00
|
|
|
yaml-dev \
|
|
|
|
|
gcompat \
|
2025-05-16 15:29:07 -04:00
|
|
|
geos \
|
2025-02-05 16:05:14 -05:00
|
|
|
&& mkdir -p $APP_PATH
|
2024-03-15 18:31:06 -04:00
|
|
|
|
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-02-06 12:06:03 -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-06 12:06:03 -05:00
|
|
|
&& bundle install --jobs 4 --retry 3 \
|
2025-05-08 06:47:53 -04:00
|
|
|
&& rm -rf vendor/bundle/ruby/3.4.1/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" ]
|