Update trips page and dockerfiles

This commit is contained in:
Eugene Burmakin
2025-05-19 19:00:34 +02:00
parent 3e8e49139a
commit 34c82e82a5
10 changed files with 116 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
FROM ruby:3.4.1-alpine
FROM ruby:3.4.1-slim
ENV APP_PATH=/var/app
ENV BUNDLE_VERSION=2.5.21
@@ -10,25 +10,30 @@ ENV SELF_HOSTED=true
ENV SIDEKIQ_USERNAME=sidekiq
ENV SIDEKIQ_PASSWORD=password
# Install dependencies for application
RUN apk -U add --no-cache \
build-base \
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
git \
postgresql-dev \
postgresql-client \
libpq-dev \
libxml2-dev \
libxslt-dev \
nodejs \
yarn \
libyaml-dev \
libgeos-dev libgeos++-dev \
imagemagick \
tzdata \
nodejs \
yarn \
less \
yaml-dev \
gcompat \
geos \
&& mkdir -p $APP_PATH
libjemalloc2 libjemalloc-dev \
&& mkdir -p $APP_PATH \
&& rm -rf /var/lib/apt/lists/*
# Update gem system and install bundler
# Use jemalloc
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
# Optional: Set YJIT explicitly (enabled by default in 3.4.1 MRI builds)
ENV RUBY_YJIT_ENABLE=1
# Update RubyGems and install Bundler
RUN gem update --system 3.6.2 \
&& gem install bundler --version "$BUNDLE_VERSION" \
&& rm -rf $GEM_HOME/cache/*
@@ -37,15 +42,12 @@ WORKDIR $APP_PATH
COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./
# Install all gems into the image
RUN bundle config set --local path 'vendor/bundle' \
&& bundle install --jobs 4 --retry 3 \
&& rm -rf vendor/bundle/ruby/3.4.1/cache/*.gem
# Copy the rest of the application
COPY ../. ./
# Copy entrypoint scripts and grant execution permissions
COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh
RUN chmod +x /usr/local/bin/web-entrypoint.sh
@@ -54,4 +56,4 @@ RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh
EXPOSE $RAILS_PORT
ENTRYPOINT [ "bundle", "exec" ]
ENTRYPOINT ["bundle", "exec"]