-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker: build frontend dependencies with node and yarn #1113
Docker: build frontend dependencies with node and yarn #1113
Conversation
86bc344
to
a9bad6e
Compare
docker/alpine/Dockerfile.master
Outdated
@@ -8,6 +8,16 @@ RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - | |||
&& composer --prefer-dist --no-dev install | |||
|
|||
# Stage 2: | |||
# - Frontend dependencies | |||
FROM node:latest as node | |||
RUN echo `pwd` |
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.
debug?
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.
🙊
docker/alpine/Dockerfile.master
Outdated
@@ -8,6 +8,16 @@ RUN curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xzf - | |||
&& composer --prefer-dist --no-dev install | |||
|
|||
# Stage 2: | |||
# - Frontend dependencies | |||
FROM node:latest as node |
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.
suggestions:
- use an Alpine-based image for size & speed
- pin the major (and maybe minor?) NodeJS version
e.g. FROM node:9.9-alpine
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.
Hm, good idea, the size ratio is 1/10:
node 9.9-alpine 3e60aa6db49b 5 days ago 68.4MB
node latest 4885ab8871c2 5 days ago 673MB
a9bad6e
to
94abe0a
Compare
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.
Builds and runs fine!
There's a Node warning that can be easily fixed:
yarn install v1.5.1
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 22.29s.
yarn run v1.5.1
warning package.json: No license field
Based on #1072 - please only check the latest commit.
Tested locally, it seems to work fine.
Currently, it can be tested by replacing the code retrieval with: