mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-24 19:59:12 +00:00
[misc]: add http service proxy between ui and api
This commit is contained in:
parent
b90bb5c2ed
commit
0f48567f17
3 changed files with 28 additions and 0 deletions
|
@ -1,6 +1,14 @@
|
|||
version: '2.1'
|
||||
services:
|
||||
|
||||
proxy:
|
||||
image: katie/roleypoly-proxy:latest
|
||||
ports:
|
||||
- 6770:80
|
||||
environment:
|
||||
UI_ADDR: 172.17.0.1:6768
|
||||
API_ADDR: 172.17.0.1:6769
|
||||
|
||||
pg:
|
||||
image: postgres:10-alpine
|
||||
container_name: roleypoly-pg
|
||||
|
|
3
etc/proxy/Dockerfile
Normal file
3
etc/proxy/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM haproxy:1.9-alpine
|
||||
ENV UI_ADDR=ui:6768 API_ADDR=api:6769
|
||||
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
|
17
etc/proxy/haproxy.cfg
Normal file
17
etc/proxy/haproxy.cfg
Normal file
|
@ -0,0 +1,17 @@
|
|||
frontend www-incoming
|
||||
bind :80
|
||||
mode http
|
||||
default_backend ui
|
||||
acl api_req path -i -m beg /api
|
||||
acl api_req path -i -m beg /magic
|
||||
use_backend api if api_req
|
||||
|
||||
backend ui
|
||||
mode http
|
||||
balance roundrobin
|
||||
server server0 ${UI_ADDR} check
|
||||
|
||||
backend api
|
||||
mode http
|
||||
balance roundrobin
|
||||
server server0 ${API_ADDR} check
|
Loading…
Add table
Reference in a new issue