diff --git a/Dockerfile b/Dockerfile index 8c6380e..c220e01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ -FROM ubuntu:plucky +FROM node AS build -RUN apt update && apt upgrade -y +WORKDIR /app -RUN apt install git -y +COPY package*.json ./ -RUN mkdir library && cd library +RUN npm install -WORKDIR ~/library/ +COPY . . -RUN git init +RUN npm run build --configuration=production -RUN git remote add origin https://github.com/dumsilor/library.git +FROM nginx -RUN git pull origin master +COPY --from=build /app/dist/navigator/browser /usr/share/nginx/html -RUN apt install npm +COPY nginx.conf /etc/nginx/nginx.conf -RUN npm i +COPY default.conf /etc/nginx/conf.d/default.conf -CMD ["ng","serve"] +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 8ed59da..0c87e5f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,11 +10,9 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; + + # Include the default server configuration include /etc/nginx/conf.d/*.conf; } diff --git a/nginx.conf.bkp b/nginx.conf.bkp new file mode 100644 index 0000000..8ed59da --- /dev/null +++ b/nginx.conf.bkp @@ -0,0 +1,20 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + include /etc/nginx/conf.d/*.conf; +} diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index bce33ed..a77a089 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -4,6 +4,7 @@ import { ShiftUpdateComponent } from './components/pages/shift-update/shift-upda import { NoMansLandComponent } from './components/pages/no-mans-land/no-mans-land.component'; import { ToolListComponent } from './components/pages/tool-list/tool-list.component'; import { LoginComponent } from './components/pages/login/login.component'; +import { BitComponent } from './components/pages/bit/bit.component'; export const routes: Routes = [ {path: "", component: NoMansLandComponent}, @@ -11,5 +12,6 @@ export const routes: Routes = [ {path: "update", component: ShiftUpdateComponent}, {path: "creds", component: ToolListComponent }, {path: "login", component: LoginComponent }, + {path: 'bits', component: BitComponent}, {path: "**", component: NoMansLandComponent}, ]; diff --git a/src/app/components/pages/bit/bit.component.html b/src/app/components/pages/bit/bit.component.html new file mode 100644 index 0000000..18f1d55 --- /dev/null +++ b/src/app/components/pages/bit/bit.component.html @@ -0,0 +1,16 @@ +
{{ value * factor }} {{selectedUnit}}
+