| server { |
| listen 80; |
| server_name localhost; |
| location /test { |
| proxy_pass http://app:3000/test;
# proxy_pass http://192.168.1.100:3000/test;
|
| proxy_http_version 1.1; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection 'upgrade'; |
| proxy_set_header Host $host; |
| proxy_cache_bypass $http_upgrade; |
| } |
| location / { |
| proxy_pass http://app2:3001;
# proxy_pass http://192.168.1.100:3001;
|
| proxy_http_version 1.1; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection 'upgrade'; |
| proxy_set_header Host $host; |
| proxy_cache_bypass $http_upgrade; |
| } |
| location /parse { |
| proxy_pass http://parse-server:1337/parse;
# proxy_pass http://192.168.1.100:1337/parse; |
| proxy_http_version 1.1; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection 'upgrade'; |
| proxy_set_header Host $host; |
| proxy_cache_bypass $http_upgrade; |
| } |
| |
| }
docker-compose.yml <
version: '2' |
| services: |
| app: |
| image: "node:latest" |
| working_dir: /usr/src/app |
| command: ./run-dev.sh |
| volumes: |
| - ./app:/usr/src/app |
| environment: |
| - port=3000 |
| depends_on: |
| - parse-server |
| app2: |
| image: "node:latest" |
| working_dir: /usr/src/app |
| command: ./run-dev.sh |
| volumes: |
| - ./app:/usr/src/app |
| environment: |
| - port=3001 |
| depends_on: |
| - parse-server |
| mongo: |
| image: "mongo" |
| |
| parse-server: |
| image: yongjhih/parse-server |
| # ports: |
| # - "1337:1337" |
| environment: |
| PORT: 1337 |
| DATABASE_URI: "mongodb://mongo:27017/test" |
| APP_ID: "test" |
| MASTER_KEY: test_MASTER_KEY |
| JAVASCRIPT_KEY: test_JAVASCRIPT_KEY |
| links: |
| - mongo |
| depends_on: |
| - mongo |
| nginx: |
| image: nginx |
| ports: |
| - "5010:80" |
| volumes: |
| - ./proxy/conf.d:/etc/nginx/conf.d |
| links: |
| - parse-server |
| - mongo |
| - app |
| - app2 |
|
沒有留言:
張貼留言