diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..392e2d6 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,45 @@ +services: + web: + build: . + ports: + - "${PORT:-4000}:3000" + environment: + - RAILS_ENV=production + - RAILS_MASTER_KEY + - DATABASE_URL + - HOST + - RAILS_LOG_LEVEL + - RAILS_MAX_THREADS + - GOOD_JOB_EXECUTION_MODE=external + - SMTP_USER_NAME + - SMTP_PASSWORD + - SMTP_ADDRESS + - GEMINI_API_KEY + - APPSIGNAL_PUSH_API_KEY + depends_on: + worker: + condition: service_started + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3000/up"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s + + worker: + build: . + command: bundle exec good_job start + environment: + - RAILS_ENV=production + - RAILS_MASTER_KEY + - DATABASE_URL + - HOST + - RAILS_LOG_LEVEL + - GOOD_JOB_EXECUTION_MODE=external + - SMTP_USER_NAME + - SMTP_PASSWORD + - SMTP_ADDRESS + - GEMINI_API_KEY + - APPSIGNAL_PUSH_API_KEY + restart: unless-stopped