added docker image
All checks were successful
continuous-integration/drone/push Build is passing

added ci build
This commit is contained in:
Samuel Philipp 2020-05-06 17:54:32 +02:00
parent a4542f7abd
commit a7aceff686
4 changed files with 28 additions and 1 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
node_modules/

18
.drone.yml Normal file
View file

@ -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 Normal file
View file

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

View file

@ -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)