services:
proxy:
image: nginx:1.27-alpine
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- frontend
- api
frontend:
image: nginx:1.27-alpine
volumes:
- ./frontend:/usr/share/nginx/html:ro
api:
image: hashicorp/http-echo:1.0
command: ["-text=API OK"] services:
proxy:
image: nginx:1.27-alpine
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- frontend
- api
frontend:
image: nginx:1.27-alpine
volumes:
- ./frontend:/usr/share/nginx/html:ro
api:
image: hashicorp/http-echo:1.0
command: ["-text=API OK"] events {}
http {
upstream front { server frontend:80; }
upstream back { server api:5678; }
server {
listen 80;
location /api/ {
proxy_pass http://back/;
}
location / {
proxy_pass http://front;
}
}
} events {}
http {
upstream front { server frontend:80; }
upstream back { server api:5678; }
server {
listen 80;
location /api/ {
proxy_pass http://back/;
}
location / {
proxy_pass http://front;
}
}
}