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
Puma silently exits inside docker container #1790
Comments
Can I get a Dockerfile that reproduces the issue? |
Dockerfile
init_container.sh:
|
I've tried to repro this without success using Rails 5.2.3 and Ruby 2.4.5. This might be a bit easier if you pushed your container somewhere like Docker Hub and shared it or pointed out what I'm doing wrong? I generated a brand new Rails app called
Here is my output:
|
I'm recently having issues getting my Rails app to boot in my Dockerfile. The problem appears between these commits: glowfic-constellation/glowfic@57c913b...f14fae9; I can check out the first commit and have the app work perfectly, I check out the second and it reliably fails. I suspect this may be related and am posting here for others in case it constitutes a repro; off to try things myself like "don't upgrade Puma patch versions" or "move puma around in my Gemfile". Edit/update: moving the puma gem out of the production group had no effect; downgrading puma 3.12.1 to 3.12.0 fixed the problem. |
@Marri are you able to try out the Puma master branch? it might have been fixed as bunch of stuff hasn't been released yet here's the diff between 3.12.0 and 3.12.1 if anyone wants to take a look: v3.12.0...v3.12.1 |
@dentarg sure! But no luck :/ Things done for debugging posterity:
|
@Deekor and @Marri @Deekor I've got a number of cron jobs running with one of my applications. To do this I build the container and run a difference long standing process as a service in a # Dockerfile
# Install crontab and give the user 'app' access to be call and run cronjobs
RUN addgroup crontab && \
apt-get -qq update && apt-get install -y cron && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
touch /var/log/cron.log && touch /etc/cron.allow && \
echo "app" > /etc/cron.allow
# Create a cronjob to run a specific task
RUN (crontab -l ; echo "*/5 * * * * cd /app && RAILS_ENV=production /usr/local/bundle/bin/bundle exec rake sometask > /dev/null") | crontab # docker-compose.yml
version: 3.7
# Config that need to be passed to both the application and service containers
x-common-defaults: &app-defaults
image: my_rails_app:0.0.1
environment:
- RAILS_ENV=${RAILS_ENV}
- RAILS_MASTER_KEY=${RAILS_MASTER_KEY}
services:
app:
<<: *app-defaults
command: rails s
volumes:
- public:/volumes/public
cron:
<<: *app-defaults
command: cron -f
volumes:
public: ~ Note this is just snip and should be modified to suite your applications needs. |
Sorry I missed this @tarellel; editing a comment with an @ must not ping me :/ Just came back to this because we're trying to do another round of gem upgrades and took the steps mentioned; turned off the web container (
Despite what the logs claim, it does not work and the app refuses to load. When I spin down web, it even prints
and yet, localhost:3000 has... nothing. Problem still exists. Feel free to try yourself: https://github.com/Marri/glowfic |
Update: PROGRESS. Update the second: |
Rails 5.2.3
Puma 3.12.1
Ive dockerized my rails app and when I start the container with the command
rails s puma
, Puma boots and then silently exits:There are no more logs after that and the container is no longer running. Puma still works fine outside of docker.
Any ideas?
The text was updated successfully, but these errors were encountered: