mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Docker config
This commit is contained in:
25
Display/Dockerfile
Normal file
25
Display/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
### STAGE 1: Build ###
|
||||
|
||||
FROM node:12.11.0-alpine as builder
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
RUN npm ci && mkdir /ng-app && mv ./node_modules ./ng-app
|
||||
|
||||
WORKDIR /ng-app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run ng build -- --prod --output-path=dist
|
||||
|
||||
### STAGE 2: Setup ###
|
||||
|
||||
FROM nginx:1.17.4-alpine
|
||||
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/
|
||||
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
COPY --from=builder /ng-app/dist /usr/share/nginx/html
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
40
Display/nginx/default.conf
Normal file
40
Display/nginx/default.conf
Normal file
@@ -0,0 +1,40 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
sendfile on;
|
||||
|
||||
default_type application/octet-stream;
|
||||
|
||||
gzip on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
gzip_min_length 1100;
|
||||
gzip_vary on;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
gzip_comp_level 9;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location /api/weather/ {
|
||||
proxy_pass http://172.23.10.3:80;
|
||||
}
|
||||
|
||||
location /api/hub/ {
|
||||
proxy_pass http://172.23.10.3:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
|
||||
location /socket.io {
|
||||
proxy_pass http://172.23.10.30:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,7 @@ enum TimeSpan {
|
||||
export class WeatherChartsComponent implements OnInit {
|
||||
|
||||
public chart: Chart;
|
||||
|
||||
private loading = true;
|
||||
|
||||
public loading = true;
|
||||
public timeSpanItems: { [value: number]: string } = {};
|
||||
public timeSpans: typeof TimeSpan = TimeSpan;
|
||||
public maxDate: moment.Moment = moment().endOf('day');
|
||||
|
||||
Reference in New Issue
Block a user