Jamie Curnow před 7 roky
rodič
revize
f9c003ad1f
6 změnil soubory, kde provedl 19 přidání a 35 odebrání
  1. 6 6
      Jenkinsfile
  2. 0 20
      bin/gulp
  3. 3 4
      docker-compose.yml
  4. 7 3
      nodemon.json
  5. 2 1
      rootfs/etc/services.d/manager/run
  6. 1 1
      webpack.config.js

+ 6 - 6
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 .'

+ 0 - 20
bin/gulp

@@ -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 $?

+ 3 - 4
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
-

+ 7 - 3
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"
 }

+ 2 - 1
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
+

+ 1 - 1
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