phusion / passenger-docker

Docker base images for Ruby, Python, Node.js and Meteor web apps
MIT License
2.78k stars 408 forks source link

unknown directive "passenger_enabled" #314

Closed snird closed 3 years ago

snird commented 3 years ago

I installed the passenger docker using this Dockerfile:

FROM phusion/passenger-ruby26

# Get the app in
COPY --chown=app:app . /home/app/webapp

# Get the nginx conf
RUN rm /etc/nginx/nginx.conf
COPY ./nginx.conf.local /etc/nginx/nginx.conf

# enable nginx and passenger
RUN rm -f /etc/service/nginx/down

# Bundle install
USER app
RUN gem install bundler -v 2.1.4
WORKDIR /home/app/webapp
RUN bundle install

# return to root
USER root

and my nginx config is failing on the first passenger_enabled directive.

What am I missing?

In the docker bash I ran /usr/sbin//passenger-memory-stats and got:

# /usr/sbin//passenger-memory-stats
Using /usr/local/rvm/gems/ruby-2.6.7
Version: 6.0.9
Date   : 2021-06-09 17:24:30 +0000
------------- Apache processes -------------
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.

-------- Nginx processes --------

### Processes: 0
### Total private dirty RSS: 0.00 MB

--- Passenger processes ---

### Processes: 0
### Total private dirty RSS: 0.00 MB
ed-mare commented 3 years ago

I use a different passenger docker image so I'm not sure if setup is the same. I copy the nginx config file to the /etc/nginx/sites-enabled directory. Not sure if that will make a difference but worth a try.

RUN rm -f /etc/service/nginx/down && rm /etc/nginx/sites-enabled/default
COPY ./nginx.conf.local /etc/nginx/sites-enabled/nginx.conf
snird commented 3 years ago

@ed-mare it doesn't work because my config is a complete nginx config, not just a server clause for a site