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

Dockerize civic-server #704

Merged
merged 17 commits into from
May 12, 2022
Merged

Conversation

ruslan-forostianov
Copy link
Contributor

Please see #701

Comment on lines +39 to +47
#run background tasks syncronously
config.active_job.queue_adapter = :inline

# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
#config.force_ssl = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was needed because our deployment is behind reverse proxy

@@ -36,12 +36,15 @@

# `config.assets.precompile` has moved to config/initializers/assets.rb

#run background tasks syncronously
config.active_job.queue_adapter = :inline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason, if this is not set, the deployment returns HTTP 500 for any api call...not sure why.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @acoffman can comment on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely due to the default production background jobs queue requiring redis in production. Setting it to inline will cause any background tasks (delivering notifications, analytics, generating data dumps, etc) to trigger during the request/response cycle rather than being queued for later processing.

For a smaller installation, that's probably fine, but if you notice performance issues, that could be a culprit.


echo "Migrating civic database"
# migrate:
rake db:migrate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're initializing the database from scratch here, and not running migrations in the case of an update anyways, you could just run rake db:structure:load here which will load in the schema in its entirety at once rather than stepping through each migration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acoffman I've started using the command here 63d762c

Copy link
Member

@acoffman acoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me overall. There are a couple things (like an explicit puma configuration) that you might find you need to tweak as you see what the usage looks like in your deployment, but this is a great start. Happy to merge as is, and feel free to follow up with us if you run into any issues with your deployment.

@ruslan-forostianov
Copy link
Contributor Author

This looks good to me overall. There are a couple things (like an explicit puma configuration) that you might find you need to tweak as you see what the usage looks like in your deployment, but this is a great start. Happy to merge as is, and feel free to follow up with us if you run into any issues with your deployment.

Thanks, @acoffman !

@acoffman acoffman merged commit b998045 into griffithlab:staging May 12, 2022
@pieterlukasse
Copy link
Contributor

Awesome! Thanks @ruslan-forostianov and @acoffman ! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants