diff --git a/Dockerfile b/Dockerfile index e0821a5..2f13b5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,6 +74,6 @@ USER 1000:1000 # Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint"] -# Start either web server or job worker based on PROCESS_TYPE env var +# Start either web server or job worker based on WORKER env var EXPOSE 80 -CMD ["./bin/start-process"] +CMD ["./bin/thrust", "./bin/rails", "server"] diff --git a/Procfile b/Procfile deleted file mode 100644 index f69c5b1..0000000 --- a/Procfile +++ /dev/null @@ -1,2 +0,0 @@ -web: bundle exec rails server -b 0.0.0.0 -p $PORT -worker: bundle exec good_job start diff --git a/bin/start-process b/bin/start-process deleted file mode 100755 index c8bbcd8..0000000 --- a/bin/start-process +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -e - -# Start the appropriate process based on PROCESS_TYPE environment variable -case "$PROCESS_TYPE" in - web) - echo "Starting web server..." - exec ./bin/thrust ./bin/rails server -b 0.0.0.0 -p ${PORT:-80} - ;; - worker) - echo "Starting GoodJob worker..." - exec bundle exec good_job start - ;; - *) - echo "Unknown PROCESS_TYPE: $PROCESS_TYPE" - echo "Valid options: web, worker" - exit 1 - ;; -esac diff --git a/config/initializers/good_job.rb b/config/initializers/good_job.rb index a448eb4..a05ff90 100644 --- a/config/initializers/good_job.rb +++ b/config/initializers/good_job.rb @@ -9,7 +9,7 @@ Rails.application.configure do config.good_job.poll_interval = -1 # Disable polling config.good_job.execution_mode = :inline # Run jobs inline in development else - config.good_job.execution_mode = :external + config.good_job.execution_mode = :async end config.good_job.enable_cron = Rails.env.production? diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml deleted file mode 100644 index 2491378..0000000 --- a/docker-compose.coolify.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: '3.8' - -services: - web: - build: . - environment: - - PROCESS_TYPE=web - - PORT=80 - - RAILS_ENV=production - - DATABASE_URL=${DATABASE_URL} - - RAILS_MASTER_KEY=${RAILS_MASTER_KEY} - ports: - - "80:80" - depends_on: - - worker - - worker: - build: . - environment: - - PROCESS_TYPE=worker - - RAILS_ENV=production - - DATABASE_URL=${DATABASE_URL} - - RAILS_MASTER_KEY=${RAILS_MASTER_KEY} - # No ports exposed for worker