Nginx/Passenger + Rails in the container?

0 like 0 dislike
6 views
Hello. Please tell me. I have configured server for CentOS, according to the instructions

Now I want to transfer it to the Docker container. How would the issue lie in the fact that from this statement I know that Nginx will start up the Rails server c Passenger.
server { listen 80; server_name yourserver.com; # Tell Nginx and Passenger where your app's 'public' directory is root /var/www/myapp/code/public; # Turn on Passenger passenger_enabled on; passenger_ruby /path-to-ruby; }

And ideology of each Docker container is now single server, and now Rail and Nginx should be divided, and as it correctly to make what Nginx is started the Rails server, or even how to make?
Thank you.
by | 6 views

1 Answer

0 like 0 dislike
Code Passenger - in one container, with nginx in another and reversed at first. Statics is desirable to put separately so that you can feed with nginx.

A Minimal Dockerfile:
FROM ruby:2.5-Alta ADD . /app WORKDIR /app RUN bundle install CMD ["bundle", "exec", "passenger", "start"]

docker-compose.yml:
version: '2' services: passenger: build: ./ restart: always #ports: # - 3000:3000 (for debug) nginx: image: nginx:mainline-alpine restart: always volumes: #- ./nginx.conf:/etc/nginx/nginx.conf - ./nginx-site.conf:/etc/nginx/conf.d/passenger.conf #- /path/to/static/:/path/in/container/

With nginx-site.conf instead of passenger-directives (you may need headers for proxy-type X-Real-IP): the "proxy_pass" http://passenger:3000;
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
3 answers
0 like 0 dislike
4 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
33,945 users