diff --git a/Dockerfile b/Dockerfile index d24e8828..b60951bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update -y \ && apt-get install -y git bsdmainutils vim-nox mc \ && rm -rf /var/lib/apt/lists/* -# RUN npm i -g mrs-developer +RUN npm i -g mrs-developer WORKDIR /opt/frontend/ @@ -15,7 +15,7 @@ COPY docker-image.txt / COPY . . # RUN chmod +x optimize_node_modules.sh -# RUN mkdir -p /opt/frontend/src/develop +RUN mkdir -p /opt/frontend/src/develop RUN chown -R node /opt/frontend @@ -24,30 +24,30 @@ USER node RUN echo "prefix = \"/home/node\"\n" > /home/node/.npmrc RUN rm -rf node_modules .git package-lock.json -# RUN npm install mr-developer +RUN npm install mr-developer #RUN node_modules/.bin/mrdeveloper --config=jsconfig.json --no-config --output=addons -# RUN missdev --config=jsconfig.json --output=develop +RUN missdev --config=jsconfig.json --output=develop -# RUN make activate-all +RUN make activate-all # RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm ci -RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm install +# RUN NPM_CONFIG_REGISTRY=$NPM_CONFIG_REGISTRY npm install # RUN ./optimize_node_modules.sh # RUN make clean-addons # RUN rm -f package-lock.json -RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build +# RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build # Second stage build -FROM node:12-stretch-slim +# FROM node:12-stretch-slim -COPY . /opt/frontend/ -RUN chown -R node /opt/frontend/ +# COPY . /opt/frontend/ +# RUN chown -R node /opt/frontend/ -WORKDIR /opt/frontend/ -USER node +# WORKDIR /opt/frontend/ +# USER node RUN RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn \ && RAZZLE_API_PATH=VOLTO_API_PATH RAZZLE_INTERNAL_API_PATH=VOLTO_INTERNAL_API_PATH yarn build \ diff --git a/package.json b/package.json index 9535daaf..a3be7258 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "test": "razzle test --env=jsdom --passWithNoTests", "start:prod": "NODE_ENV=production node build/server.js", "i18n": "NODE_ENV=production node node_modules/@plone/volto/src/i18n.js", + "develop:npx": "npx -p mrs-developer missdev --config=jsconfig.json --output=develop", "develop": "missdev --config=jsconfig.json --output=develop" }, "jest": { diff --git a/scripts/pkg_helper.py b/scripts/pkg_helper.py index 02016a1b..272c0459 100755 --- a/scripts/pkg_helper.py +++ b/scripts/pkg_helper.py @@ -161,7 +161,7 @@ def activate_all(): if os.path.exists(pkgdir) and os.path.isdir(pkgdir): # subprocess.call(['rm', 'package-lock.json'], cwd=pkgdir) - subprocess.call(['npm', 'install'], cwd=pkgdir) + subprocess.call(['yarn'], cwd=pkgdir) # subprocess.call(['rm', 'package-lock.json'], cwd=pkgdir)