diff --git a/Jenkinsfile b/Jenkinsfile index 8a743604..da811bd9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,10 +24,10 @@ pipeline { steps { ansiColor('xterm') { // Codebase - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:latest yarn --registry=$NPM_REGISTRY install' - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:latest npm run-script build' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:latest yarn --registry=$NPM_REGISTRY install' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:latest npm run-script build' sh 'rm -rf node_modules' - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:latest yarn --registry=$NPM_REGISTRY install --prod' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:latest yarn --registry=$NPM_REGISTRY install --prod' sh 'docker run --rm -v $(pwd):/data $DOCKER_CI_TOOLS node-prune' // Docker Build @@ -56,10 +56,10 @@ pipeline { steps { ansiColor('xterm') { // Codebase - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:armhf yarn --registry=$NPM_REGISTRY install' - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:armhf npm run-script build' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:armhf yarn --registry=$NPM_REGISTRY install' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:armhf npm run-script build' sh 'rm -rf node_modules' - sh 'docker run --rm -v $(pwd):/srv/app -w /srv/app $BASE_IMAGE_NAME:armhf yarn --registry=$NPM_REGISTRY install --prod' + sh 'docker run --rm -v $(pwd):/app -w /app $BASE_IMAGE_NAME:armhf yarn --registry=$NPM_REGISTRY install --prod' // Docker Build sh 'docker build --pull --no-cache --squash --compress -t $TEMP_IMAGE_NAME_ARM -f Dockerfile.armhf .' diff --git a/bin/gulp b/bin/gulp deleted file mode 100755 index ca51616e..00000000 --- a/bin/gulp +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if hash realpath 2>/dev/null; then - export CODEBASE=$(realpath $SCRIPT_DIR/..) -elif hash grealpath 2>/dev/null; then - export CODEBASE=$(grealpath $SCRIPT_DIR/..) -else - export CODEBASE=$(readlink -e $SCRIPT_DIR/..) -fi - -if [ -z "$CODEBASE" ]; then - echo "Unable to determine absolute codebase directory" - exit 1 -fi - -cd "$CODEBASE" - -/usr/local/bin/docker-compose run --no-deps --rm -w /srv/manager app gulp $@ -exit $? diff --git a/docker-compose.yml b/docker-compose.yml index dee8bb50..f75abf42 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "2" services: app: - image: jc21/node + image: jc21/nginx-proxy-manager-base:latest ports: - 8080:80 - 8081:81 @@ -11,7 +11,8 @@ services: - FORCE_COLOR=1 volumes: - ./data/letsencrypt:/etc/letsencrypt - - .:/srv/app + - .:/app + working_dir: /app depends_on: - db links: @@ -27,5 +28,3 @@ services: volumes: - ./config/my.cnf:/etc/mysql/conf.d/npm.cnf - ./data/mysql:/var/lib/mysql - - ./data/initial-sql:/docker-entrypoint-initdb.d - diff --git a/nodemon.json b/nodemon.json index 3c454d1e..bcbb216c 100644 --- a/nodemon.json +++ b/nodemon.json @@ -1,5 +1,9 @@ { - "verbose": false, - "ignore": ["dist", "data", "src/frontend"], - "ext": "js json ejs" + "verbose": false, + "ignore": [ + "dist", + "data", + "src/frontend" + ], + "ext": "js json ejs" } diff --git a/rootfs/etc/services.d/manager/run b/rootfs/etc/services.d/manager/run index 598f86af..13e14e8d 100755 --- a/rootfs/etc/services.d/manager/run +++ b/rootfs/etc/services.d/manager/run @@ -2,5 +2,6 @@ mkdir -p /data/letsencrypt-acme-challenge -cd /srv/app +cd /app node --abort_on_uncaught_exception --max_old_space_size=250 /app/src/backend/index.js + diff --git a/webpack.config.js b/webpack.config.js index 91fed7c7..30f658ca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -107,7 +107,7 @@ module.exports = { from: 'src/frontend/app-images', to: 'images', toType: 'dir', - context: '/srv/app' + context: '/app' }]), new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1, // Must be greater than or equal to one