Merge pull request #137 from mozilla/dockerbuild

refactored docker build
This commit is contained in:
Danny Coates 2017-06-23 18:24:16 -07:00 committed by GitHub
commit dff136b70f
5 changed files with 32 additions and 19 deletions

View file

@ -2,3 +2,6 @@ node_modules
.git .git
.DS_Store .DS_Store
static static
test
scripts
docs

View file

@ -6,7 +6,7 @@ RUN chown -R app /app
USER app USER app
WORKDIR /app WORKDIR /app
RUN mkdir static RUN mkdir static
RUN npm install && npm cache clean --force RUN npm install --production && npm cache clean --force
ENV PORT=1443 ENV PORT=1443
EXPOSE $PORT EXPOSE $PORT

View file

@ -8,12 +8,14 @@ deployment:
latest: latest:
branch: master branch: master
commands: commands:
- npm run predocker
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t mozilla/fileshare:latest . - docker build -t mozilla/fileshare:latest .
- docker push mozilla/fileshare:latest - docker push mozilla/fileshare:latest
tags: tags:
tags: /.*/ tags: /.*/
commands: commands:
- npm run predocker
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t mozilla/fileshare:$CIRCLE_TAG . - docker build -t mozilla/fileshare:$CIRCLE_TAG .
- docker push mozilla/fileshare:$CIRCLE_TAG - docker push mozilla/fileshare:$CIRCLE_TAG

30
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "portal-alpha", "name": "portal-alpha",
"version": "1.0.0", "version": "0.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"accepts": { "accepts": {
@ -1037,9 +1037,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eslint": { "eslint": {
"version": "4.0.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.1.0.tgz",
"integrity": "sha1-cnfAFDf99B3M0WjVqg5Jt1yh8mA=", "integrity": "sha1-u7VaKCIO4Itp2pVU1FprLr/X2RM=",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"concat-stream": { "concat-stream": {
@ -1336,7 +1336,8 @@
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
}, },
"fsevents": { "fsevents": {
"version": "1.1.2", "version": "1.1.2",
@ -2027,7 +2028,8 @@
"git-rev-sync": { "git-rev-sync": {
"version": "1.9.1", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/git-rev-sync/-/git-rev-sync-1.9.1.tgz", "resolved": "https://registry.npmjs.org/git-rev-sync/-/git-rev-sync-1.9.1.tgz",
"integrity": "sha1-oMLj3TkqvPa3aWLif8dfsyI0Sc4=" "integrity": "sha1-oMLj3TkqvPa3aWLif8dfsyI0Sc4=",
"dev": true
}, },
"glob": { "glob": {
"version": "6.0.4", "version": "6.0.4",
@ -2287,7 +2289,8 @@
"interpret": { "interpret": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz",
"integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=" "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=",
"dev": true
}, },
"ipaddr.js": { "ipaddr.js": {
"version": "1.3.0", "version": "1.3.0",
@ -3216,7 +3219,8 @@
"path-parse": { "path-parse": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
}, },
"path-platform": { "path-platform": {
"version": "0.11.15", "version": "0.11.15",
@ -3631,7 +3635,8 @@
"rechoir": { "rechoir": {
"version": "0.6.2", "version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=" "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"dev": true
}, },
"redent": { "redent": {
"version": "1.0.0", "version": "1.0.0",
@ -3703,7 +3708,8 @@
"resolve": { "resolve": {
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz",
"integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=" "integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=",
"dev": true
}, },
"resolve-from": { "resolve-from": {
"version": "1.0.1", "version": "1.0.1",
@ -3848,11 +3854,13 @@
"version": "0.7.7", "version": "0.7.7",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.7.tgz",
"integrity": "sha1-svXHfvlxSPS09uImguELuoZnz/E=", "integrity": "sha1-svXHfvlxSPS09uImguELuoZnz/E=",
"dev": true,
"dependencies": { "dependencies": {
"glob": { "glob": {
"version": "7.1.2", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==" "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
} }
} }
}, },

View file

@ -1,7 +1,7 @@
{ {
"name": "portal-alpha", "name": "portal-alpha",
"description": "P2P File Sharing Experiment", "description": "File Sharing Experiment",
"version": "1.0.0", "version": "0.1.0",
"author": "Mozilla (https://mozilla.org)", "author": "Mozilla (https://mozilla.org)",
"dependencies": { "dependencies": {
"aws-sdk": "^2.62.0", "aws-sdk": "^2.62.0",
@ -12,7 +12,6 @@
"cross-env": "^5.0.1", "cross-env": "^5.0.1",
"express": "^4.15.3", "express": "^4.15.3",
"express-handlebars": "^3.0.0", "express-handlebars": "^3.0.0",
"git-rev-sync": "^1.9.1",
"helmet": "^3.6.1", "helmet": "^3.6.1",
"jquery": "^3.2.1", "jquery": "^3.2.1",
"mozlog": "^2.1.1", "mozlog": "^2.1.1",
@ -27,6 +26,7 @@
"eslint-plugin-mocha": "^4.11.0", "eslint-plugin-mocha": "^4.11.0",
"eslint-plugin-node": "^5.0.0", "eslint-plugin-node": "^5.0.0",
"eslint-plugin-security": "^1.4.0", "eslint-plugin-security": "^1.4.0",
"git-rev-sync": "^1.9.1",
"mocha": "^3.4.2", "mocha": "^3.4.2",
"npm-run-all": "^4.0.2", "npm-run-all": "^4.0.2",
"prettier": "^1.4.4", "prettier": "^1.4.4",
@ -43,14 +43,14 @@
"license": "MPL-2.0", "license": "MPL-2.0",
"repository": "mozilla/something-awesome", "repository": "mozilla/something-awesome",
"scripts": { "scripts": {
"bundle": "browserify frontend/src/main.js | uglifyjs > public/bundle.js && node scripts/version", "predocker": "browserify frontend/src/main.js | uglifyjs > public/bundle.js && npm run version",
"dev": "watchify frontend/src/main.js -o public/bundle.js -d | node server/portal_server", "dev": "npm run version && watchify frontend/src/main.js -o public/bundle.js -d | node server/portal_server",
"format": "prettier '{frontend/src/,scripts/,server/,test/}*.js' 'public/*.css' --single-quote --write", "format": "prettier '{frontend/src/,scripts/,server/,test/}*.js' 'public/*.css' --single-quote --write",
"lint": "npm-run-all lint:*", "lint": "npm-run-all lint:*",
"lint:css": "stylelint 'public/*.css'", "lint:css": "stylelint 'public/*.css'",
"lint:js": "eslint .", "lint:js": "eslint .",
"prestart": "npm run bundle",
"start": "cross-env NODE_ENV=production node server/portal_server", "start": "cross-env NODE_ENV=production node server/portal_server",
"test": "mocha" "test": "mocha",
"version": "node scripts/version"
} }
} }