Skip to content
This repository has been archived by the owner on Jul 4, 2019. It is now read-only.

Use Alpine Linux #64

Merged
merged 6 commits into from
Dec 24, 2016
Merged

Use Alpine Linux #64

merged 6 commits into from
Dec 24, 2016

Conversation

danielbayerlein
Copy link
Owner

Switch to Alpine Linux (https://alpinelinux.org) it saves a lot of space. 👾

@danielbayerlein
Copy link
Owner Author

Once yarnpkg/yarn#1326 is done, the use of Yarn will be easier.

@chrishelgert
Copy link
Collaborator

@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
Copy link
Collaborator

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

Copy link
Owner Author

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. 😳

Copy link
Owner Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielbayerlein nice choice 👍

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 9e3c1ff on alpine into c927225 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 717aa58 on alpine into 8541452 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b032b17 on alpine into 8541452 on master.

@danielbayerlein
Copy link
Owner Author

@chrishelgert Ready to review 👨‍💻


# Bundle app source
COPY . /code/<%= dir %>

# Build
RUN yarn run build
# Set environment variable
Copy link
Collaborator

@chrishelgert chrishelgert Dec 23, 2016

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 😉

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 141faad on alpine into 8541452 on master.

@chrishelgert chrishelgert merged commit fd7f362 into master Dec 24, 2016
@chrishelgert chrishelgert deleted the alpine branch December 24, 2016 13:20
@chrishelgert
Copy link
Collaborator

chrishelgert commented Dec 24, 2016

nice 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants