Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solid_queue via puma plugin #95

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ RUN --mount=type=cache,id=gem-cache-3.3,sharing=locked,target=/srv/vendor \
bundle config set without 'development test toolbox' && \
bundle install --jobs 8 && \
bundle clean && \
gem install foreman && \
mkdir -p vendor && \
bundle config set --local path vendor && \
cp -ar /srv/vendor . && \
Expand All @@ -53,6 +52,8 @@ RUN --mount=type=cache,id=bld-assets-cache,sharing=locked,target=tmp/cache/asset
# Final stage for app image
FROM base

ENV SOLID_QUEUE_IN_PUMA="1"

# Install packages needed for deployment
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
Expand Down Expand Up @@ -82,4 +83,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"]

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD ["foreman", "start"]
CMD ["./bin/rails", "server"]
2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

2 changes: 1 addition & 1 deletion bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

if [ "${*}" == "foreman start" ]; then
if [ "${*}" == "./bin/rails server" ]; then
# Create and prepare the database
./bin/rails db:prepare
# Create the configured SHIPYRD_API_KEY
Expand Down
1 change: 1 addition & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ENV["RAILS_ENV"] ||= "test"
ENV["SOLID_QUEUE_IN_PUMA"] = "1"
require_relative "../config/environment"
require "rails/test_help"
require "webmock/minitest"
Expand Down
Loading