Skip to content

Commit

Permalink
Updated build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Aug 31, 2020
1 parent b452401 commit 3e4488a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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/

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

Expand All @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/pkg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 3e4488a

Please sign in to comment.