Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

526
Visualizações
Elastic Beanstalk: customize Puma configuration

The current Beanstalk solution stack for Ruby + Puma uses the configuration file at /opt/elasticbeanstalk/support/conf/pumaconf.rb and ignores the config/puma.rb inside the Rails application directory.

I could override the file above with a custom one via .ebextensions but am hesitant because I'd like to avoid breakage in case the path to the PID or - more importantly - unix socket files changes in upcoming solution stack versions.

What is the best practice for customizing the Puma configuration on Beanstalk?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

We use Ruby+Passenger, but it sounds similar enough to your situation. We need to customize the nginx configuration file stored at /opt/elasticbeanstalk/support/conf/nginx_config.erb, so we do it via .ebextensions and sed.

Here's an example to get you started:

.ebextensions/01-edit-nginx.config

container_commands:
  01backup_config:
    command: "cp -n /opt/elasticbeanstalk/support/conf/nginx_config.erb /opt/elasticbeanstalk/support/conf/nginx_config.erb.original"
  02edit_config:
    command: "sh -c \"sed '/string_to_insert_text_after/ i\
\    text_to_be_inserted;' /opt/elasticbeanstalk/support/conf/nginx_config.erb.original > /opt/elasticbeanstalk/support/conf/nginx_config.erb\""

This will make a backup copy of the configuration file (without overwriting it if it already exists, thanks to the -n flag) and then insert the line "text_to_be_inserted" after the line "string_to_insert_text_after". You can pipe multiple sed commands together to insert multiple lines.

over 4 years ago · Santiago Trujillo Relatório

0

On Amazon Linux 2, you can use Procfile to do this, e.g.

web: puma -C /var/app/current/config/puma.rb

See the docs at https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ruby-platform-procfile.html for more information.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda