1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add docker-compose production files

This commit is contained in:
Markus Grigull 2017-04-13 08:59:38 +02:00
parent bc8bdca839
commit a1ac2c4aa6
2 changed files with 56 additions and 0 deletions

24
docker-compose.yml Normal file
View file

@ -0,0 +1,24 @@
version: "2"
services:
frontend:
image: nginx:stable
volumes:
- ./nginx:/etc/nginx/conf.d/
- ./build:/www
links:
- backend
ports:
- "80:80"
- "443:443"
backend:
image: villasweb-backend
links:
- database
database:
image: mongo:latest
volumes:
- /opt/database:/data/db

32
nginx/villas.conf Normal file
View file

@ -0,0 +1,32 @@
server {
listen 80 default_server;
server_name VILLASweb;
# backend location
location /api/ {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# rewrite url to exclude /api on context broker side
rewrite ^/api/?(.*) /api/v1/$1 break;
proxy_pass http://backend:4000/;
}
# frontend location
location / {
root /www;
}
# error pages
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}