diff --git a/.dockerignore b/.dockerignore index cf7fbbfac..3cdd2a257 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,10 @@ .* # you can add exceptions like in .gitignore to maintain a whitelist: # e.g. -#!.babelrc +!.babelrc +!.eslintrc +!.eslintignore +!.stylelintrc # not going to run tests inside the docker container test/ diff --git a/Dockerfile b/Dockerfile index dd7467c20..7b8147af9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,16 @@ WORKDIR $APPDIR ADD . $APPDIR -RUN npm install +RUN npm config set registry http://registry.npmjs.org/ + +RUN npm install -g -s --no-progress yarn --pure-lockfile && \ + yarn + +ENV NODE_ENV=production + +RUN yarn run build:webui && \ + yarn cache clean && \ + yarn install --production --pure-lockfile RUN mkdir -p /verdaccio/storage /verdaccio/conf ADD conf/docker.yaml /verdaccio/conf/config.yaml diff --git a/package.json b/package.json index 9efa214bc..c49d08e82 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "test-only": "mocha ./test/functional ./test/unit", "lint": "eslint .", "lint:css": "stylelint 'src/**/*.scss' --syntax scss", - "build-docker": "docker build -t verdaccio .", + "build-docker": "docker build -t verdaccio . --no-cache", "build:webui": "rimraf static/* && webpack --config tools/webpack.prod.config.babel.js --debug", "dev:webui": "babel-node tools/dev.server.js", "prepublish": "in-publish && npm run build:webpack || not-in-publish",