Skip to content

Instantly share code, notes, and snippets.

@thefringeninja
Created July 4, 2018 11:22
Show Gist options
  • Save thefringeninja/4aa4755e2bb45825869853630019ec2f to your computer and use it in GitHub Desktop.
Save thefringeninja/4aa4755e2bb45825869853630019ec2f to your computer and use it in GitHub Desktop.
Sql Stream Store Docker Compose Example
version: '3.1'
services:
nginx:
container_name: sql-stream-store-nginx-proxy
image: nginx:1.15.0-alpine
build:
context: ./nginx
ports:
- "9000:80"
networks:
- app-network
frontend:
container_name: sql-stream-store-client
image: sql-stream-store-browser
ports:
- "3000:80"
networks:
- app-network
backend:
container_name: sql-stream-store-hal
image: sql-stream-store-hal
ports:
- "5000:80"
networks:
- app-network
networks:
app-network:
driver: bridge
FROM nginx:1.15.0-alpine
COPY ./nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]
worker_processes 4;
events { worker_connections 1024; }
http {
sendfile on;
upstream frontend {
server frontend;
}
upstream backend {
server backend;
}
map $http_accept $backend {
default frontend;
"application/hal+json" backend;
}
server {
listen 80;
location / {
proxy_pass http://$backend$uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment