Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 7545000

Browse files
committed
Add app volume to sidekiq worker process definition in docker compose
1 parent a288f71 commit 7545000

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

backend/app/controllers/api/status_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@ class Api::StatusController < ApplicationController
22
def index
33
render json: { status: "OK" }
44
end
5+
6+
def job
7+
# Just an example of enqueuing an ActiveJob to the worker container.
8+
# perform_later will cause it to be enqueud to the worker
9+
# whilst perform will cause it to be executed in the current Rails process
10+
TestJob.perform_later
11+
end
512
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
class ApplicationJob < ActiveJob::Base
2+
queue_as :default
23
end

backend/app/jobs/test_job.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class TestJob < ApplicationJob
2+
def perform
3+
Rails.logger.info "BOOBS"
4+
end
5+
end

backend/config/environments/development.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# Raise an error on page load if there are pending migrations.
3838
config.active_record.migration_error = :page_load
3939

40-
4140
# Raises error for missing translations
4241
# config.action_view.raise_on_missing_translations = true
4342

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ services:
1212
command: bundle exec sidekiq
1313
environment:
1414
REDIS_URL: redis://redis:6379/0
15+
volumes:
16+
- ./backend:/usr/src/backend-app
1517
depends_on:
1618
- db
1719
- redis

0 commit comments

Comments
 (0)