mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Merge branch 'develop' of rwth-gitlab:VILLASframework/VILLASweb into develop
This commit is contained in:
commit
2bb1611842
6 changed files with 37 additions and 7 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules/
|
||||
nginx/
|
||||
doc/
|
||||
build/
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM node:latest
|
||||
|
||||
RUN mkdir /react
|
||||
RUN mkdir /result
|
||||
|
||||
VOLUME /result
|
||||
|
||||
WORKDIR /react
|
||||
|
||||
CMD npm install && npm run build && cp -R /react/build/* /result/
|
|
@ -1,24 +1,39 @@
|
|||
version: "2"
|
||||
|
||||
services:
|
||||
frontend:
|
||||
webserver:
|
||||
image: nginx:stable
|
||||
volumes:
|
||||
- ./nginx:/etc/nginx/conf.d/
|
||||
- ./build:/www
|
||||
- website-volume:/www
|
||||
links:
|
||||
- backend
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
restart: always
|
||||
|
||||
frontend:
|
||||
build: .
|
||||
volumes:
|
||||
- ./:/react
|
||||
- website-volume:/result
|
||||
|
||||
backend:
|
||||
image: villasweb-backend
|
||||
links:
|
||||
- database
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
restart: always
|
||||
|
||||
database:
|
||||
image: mongo:latest
|
||||
volumes:
|
||||
- /opt/database:/data/db
|
||||
- data-volume:/data/db
|
||||
restart: always
|
||||
user: mongodb
|
||||
|
||||
volumes:
|
||||
data-volume:
|
||||
website-volume:
|
||||
|
|
|
@ -7,10 +7,10 @@ server {
|
|||
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;
|
||||
|
||||
rewrite ^/api/?(.*) /api/$1 break;
|
||||
|
||||
proxy_pass http://backend:4000/;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"name": "villasweb-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"proxy": "http://localhost:4000",
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.7",
|
||||
"classnames": "^2.2.5",
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
import RestAPI from '../api/rest-api';
|
||||
import AppDispatcher from '../app-dispatcher';
|
||||
|
||||
const API_URL = 'http://localhost:4000/api/v1';
|
||||
const API_URL = '/api/v1';
|
||||
|
||||
class RestDataManager {
|
||||
constructor(type, url, keyFilter) {
|
||||
|
|
Loading…
Add table
Reference in a new issue