Permalink
Browse files

Adding Docker. Docs pending

  • Loading branch information...
shprink committed Dec 7, 2017
1 parent 88ec48d commit f1049927f7792e10f5c87e3a092758bf52fe7f39
Showing with 54 additions and 9 deletions.
  1. +2 −0 .dockerignore
  2. +14 −0 Dockerfile
  3. +4 −0 docker-compose.yml
  4. +5 −3 package.json
  5. 0 scripts/increaseVersion.js
  6. +8 −5 scripts/install.js
  7. +20 −0 scripts/server.js
  8. +1 −1 src/config.default.cson
View
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
View
@@ -0,0 +1,14 @@
FROM node:8.9
WORKDIR /app
COPY . /app
# cannot just run because of postinstall hook
# COPY package.json yarn.lock /app/
RUN yarn --pure-lockfile
RUN ls -la
EXPOSE 8080
RUN npm run build:pwa
CMD [ "npm", "run", "server" ]
View
@@ -0,0 +1,4 @@
version: '3'
services:
web:
build: .
View
@@ -34,8 +34,9 @@
"buildAndRun:pwa": "./scripts/buildPWAAndRun.sh",
"ionic:serve": "ionic-app-scripts serve",
"postinstall": "npm run installWPHC",
"installWPHC": "cd scripts && node ./install.js",
"report:dependencies": "./scripts/dependencyReport.sh"
"installWPHC": "node ./scripts/install.js",
"report:dependencies": "./scripts/dependencyReport.sh",
"server": "node ./scripts/server"
},
"dependencies": {
"@angular/animations": "4.4.4",
@@ -64,6 +65,7 @@
"clipboard": "^1.7.1",
"debug": "^2.6.8",
"deep-extend": "^0.4.1",
"express": "^4.16.2",
"ionic-angular": "3.8.0",
"ionicons": "3.0.0",
"lodash": "^4.17.3",
@@ -120,4 +122,4 @@
"ionic_copy": "./build/copy.js",
"ionic_watch": "./build/watch.js"
}
}
}
View
0 scripts/increaseVersion.js 100644 → 100755
No changes.
View
13 scripts/install.js 100644 → 100755
@@ -1,15 +1,18 @@
#!/usr/bin/env node
var fs = require('fs-extra');
const fs = require('fs-extra');
const path = require('path');
const ROOT = path.join(__dirname, '..');
const DIST = path.join(__dirname, '..', '/dist/');
console.log("=============================================");
console.log("Starting WordPress Hybrid Client Installation");
console.log("=============================================");
copy('../dist/config', '../config');
copy('../dist/root/config.xml', '../config.xml');
copy('../dist/root/ionic.config.json', '../ionic.config.json');
copy('../release.sh.dist', '../release.sh');
copy(path.join(DIST, 'config'), path.join(ROOT, 'config'));
copy(path.join(DIST, 'root', 'config.xml'), path.join(ROOT, 'config.xml'));
copy(path.join(DIST, 'root', 'ionic.config.json'), path.join(ROOT, 'ionic.config.json'));
function copy(source, target, overwrite) {
overwrite = process.env.CI ? true : overwrite;
View
@@ -0,0 +1,20 @@
#!/usr/bin/env node
'use strict';
const express = require('express');
const path = require('path');
// Constants
const PORT = process.env.PORT || 8080;
const HOST = '0.0.0.0';
const WWW = path.join(__dirname, '..', '/www/');
// App
const app = express();
app.use(express.static(WWW));
app.get('*', function (req, res) {
res.sendFile(WWW);
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
View
@@ -82,7 +82,7 @@ metas:
formatDetection: 'telephone=no'
tapHighlight: 'no'
themeColor: '#4e8ef7'
contentSecurityPolicy: "default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"
contentSecurityPolicy: "default-src *; img-src *;style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"
# Open graph
ogTitle: 'You app title'
ogType: 'website'

0 comments on commit f104992

Please sign in to comment.