From ccc5224f0647edee5a7847ad53d8fdfbd2c67c71 Mon Sep 17 00:00:00 2001 From: Miha Rekar Date: Sat, 11 Nov 2023 16:47:43 +0100 Subject: [PATCH] Spin Redis to a separate instance --- Dockerfile | 21 --------------------- Procfile.fly | 2 -- 2 files changed, 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index d63e4d9e..1bf2cd31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,12 +74,6 @@ RUN bundle install && rm -rf vendor/bundle/ruby/*/cache FROM base -# install redis 7 -RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \ - echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(. /etc/os-release && echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/redis.list && \ - apt-get update -qq && \ - apt-get install --no-install-recommends -y redis-server - ARG DEPLOY_PACKAGES="postgresql-client libvips42 file vim curl gzip libsqlite3-0 ruby-foreman" ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES} @@ -90,21 +84,6 @@ RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \ ${DEPLOY_PACKAGES} \ && rm -rf /var/lib/apt/lists /var/cache/apt/archives -# configure redis -RUN sed -i 's/^daemonize yes/daemonize no/' /etc/redis/redis.conf &&\ - sed -i 's/^bind/# bind/' /etc/redis/redis.conf &&\ - sed -i 's/^protected-mode yes/protected-mode no/' /etc/redis/redis.conf &&\ - sed -i 's/^dir \/var\/lib\/redis/dir \/redis\/main/' /etc/redis/redis.conf &&\ - sed -i 's/^logfile/# logfile/' /etc/redis/redis.conf - -# set up cache redis -RUN cp /etc/redis/redis.conf /etc/redis/redis_cache.conf &&\ - sed -i 's/^port 6379/port 6380/' /etc/redis/redis_cache.conf &&\ - sed -i 's/^# maxmemory /maxmemory 100mb/' /etc/redis/redis_cache.conf &&\ - sed -i 's/^# maxmemory-policy noeviction/maxmemory-policy allkeys-lru/' /etc/redis/redis_cache.conf &&\ - sed -i 's/^pidfile \/run\/redis\/redis-server.pid/pidfile \/run\/redis\/redis-cache.pid/' /etc/redis/redis_cache.conf &&\ - sed -i 's/^dir \/redis\/main/dir \/redis\/cache/' /etc/redis/redis_cache.conf - # copy installed gems COPY --from=gems /app /app COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions diff --git a/Procfile.fly b/Procfile.fly index 60a13fcc..91414f82 100644 --- a/Procfile.fly +++ b/Procfile.fly @@ -1,4 +1,2 @@ web: bin/rails server -p 8080 -redis: redis-server /etc/redis/redis.conf -cache-redis: redis-server /etc/redis/redis_cache.conf sidekiq: bundle exec sidekiq -C config/sidekiq.yml