Browse Source

added docker image

added ci build
pull/3/head
Samuel Philipp 1 year ago
parent
commit
a7aceff686
  1. 1
      .dockerignore
  2. 18
      .drone.yml
  3. 7
      Dockerfile
  4. 3
      server.ts

1
.dockerignore

@ -0,0 +1 @@
node_modules/

18
.drone.yml

@ -0,0 +1,18 @@
kind: pipeline
name: default
steps:
- name: build
image: node
commands:
- npm install
- npm run build:ssr
- name: docker
image: plugins/docker
settings:
repo: samuelph/grafana-statuspage
username:
from_secret: USERNAME
password:
from_secret: PASSWORD

7
Dockerfile

@ -0,0 +1,7 @@
FROM node
COPY dist/grafana-statuspage /grafana-statuspage
WORKDIR /app
ENTRYPOINT ["node", "/grafana-statuspage/server/main.js"]

3
server.ts

@ -8,11 +8,12 @@ import {AppServerModule} from './src/main.server';
import {APP_BASE_HREF} from '@angular/common';
import {existsSync} from 'fs';
import {api} from './src/main.status';
import {environment} from "./src/environments/environment";
// The Express app is exported so that it can be used by serverless Functions.
export function app() {
const server = express();
const distFolder = join(process.cwd(), 'dist/grafana-statuspage/browser');
const distFolder = environment.production ? '/grafana-statuspage/browser' : join(process.cwd(), 'dist/grafana-statuspage/browser');
const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)

Loading…
Cancel
Save