-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Once yarnpkg/yarn#1326 is done, the use of Yarn will be easier. |
@danielbayerlein let´s review this tomorrow together 👍 |
RUN apk add --no-cache --virtual .app-deps python make g++ \ | ||
&& yarn --pure-lockfile \ | ||
&& yarn cache clean \ | ||
&& apk del .app-deps | ||
|
||
# Bundle app source | ||
COPY . /code/<%= dir %> | ||
|
||
# Build | ||
RUN yarn run build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 1:
build dist on local machine and only add the builded sources and production node_modules (no devDependencies - NODE_ENV production)
Option 2:
build dist-files on docker-container, clear node_modules and install only production-dependencies again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrishelgert At the moment I think option 2 is okay, but it makes the image 3 times bigger. 😳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrishelgert I'll switch to option 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbayerlein nice choice 👍
@chrishelgert Ready to review 👨💻 |
|
||
# Bundle app source | ||
COPY . /code/<%= dir %> | ||
|
||
# Build | ||
RUN yarn run build | ||
# Set environment variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbayerlein if we set the to NODE_ENV to prodution before yarn, then we won´t need --production or does yarn don´t check for ENV?
update:
https://yarnpkg.com/en/docs/cli/install#toc-yarn-install-production
Using the --production flag, or when the NODE_ENV environment variable is set to production, Yarn will not install any package listed in devDependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 😉
nice 👍 |
Switch to Alpine Linux (https://alpinelinux.org) it saves a lot of space. 👾