26 lines
785 B
Docker
26 lines
785 B
Docker
# Build Decidim with Sidekiq support
|
|
FROM decidim/decidim:0.31.0
|
|
|
|
# Switch to root to install dependencies
|
|
USER root
|
|
|
|
# Add sidekiq to Gemfile
|
|
RUN cd /code && \
|
|
echo "" >> Gemfile && \
|
|
echo "# Background job processing" >> Gemfile && \
|
|
echo "gem 'sidekiq', '~> 6.5'" >> Gemfile && \
|
|
bundle install
|
|
|
|
# Configure Rails to use Sidekiq as ActiveJob backend
|
|
RUN cd /code && \
|
|
test -d config/initializers || mkdir -p config/initializers && \
|
|
echo "Rails.application.config.active_job.queue_adapter = :sidekiq" > config/initializers/active_job.rb && \
|
|
cat config/initializers/active_job.rb && \
|
|
ls -la config/initializers/
|
|
|
|
# Switch back to decidim user
|
|
USER decidim
|
|
|
|
# Default command (can be overridden)
|
|
CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"]
|