作為Docker以及Ngnix的配置新手我卡關了
我在嘗試以docker來scale up Rails系統 在沒有Ngnix時我是能夠成夠運行Rails系統的
但當使用nginx-proxy後及Scale up後我發現rails不能再指定某個port了 而且proxy也不能指向Rails系統群作load balancing
同時有沒有關於Ngnix配置的常數作參考?
我的docker-compose.yml
配置如下
version: '3'
services:
db:
container_name: 'postgresql'
image: postgres
ports:
- '5432:5432'
redis:
container_name: 'redis'
image: 'redis:4.0.8-alpine'
command: redis-server --requirepass yourpassword
ports:
- '6379:6379'
volumes:
- 'redis:/data'
web:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s"
volumes:
- .:/mapAPI
env_file:
- '.env'
depends_on:
- db
- redis
sidekiq:
depends_on:
- 'db'
- 'redis'
build: .
command: bundle exec sidekiq -C config/sidekiq.yml
volumes:
- '.:/mapAPI'
env_file:
- '.env'
proxy:
image: jwilder/nginx-proxy:latest
ports:
- "80:80"
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
volumes:
redis:
postgres: