-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix Docker and upgrade Node #415
Changes from 7 commits
3c64705
7e66225
3bf256a
a2b6ca2
5afbab2
b28e273
53a4f3e
ebd1be5
dc866d2
596ebdd
1aa51c0
0e6ee65
2b1c742
ab76abb
0924268
08f986c
0634f9d
d8498ea
7fcee93
565a4c3
d40a7cc
9a400b8
4aea59e
ef25374
8ce35b8
8687fd7
d93e3a5
d74bd4d
27e15ca
f83e2f9
a2dd673
211eafc
d2841b3
daa6589
bf85545
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using Corepack now, not yarnPath, so this file should be deleted |
This file was deleted.
trallard marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.4.0.cjs | ||
trallard marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,14 +1,16 @@ | ||||||||||||||
FROM node:18.18-alpine3.18 | ||||||||||||||
gabalafou marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the env descriptors, this will default to
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be:
Suggested change
I think I've also seen in the wild:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the one I was suggesting https://hub.docker.com/layers/library/node/22-alpine3.20/images/sha256-85235be9f710c1ca817cb67892544b7f0cf994ef05380e8ac0d2ea58dce8a988?context=explore |
||||||||||||||
|
||||||||||||||
RUN corepack enable | ||||||||||||||
|
||||||||||||||
WORKDIR /usr/src/app | ||||||||||||||
|
||||||||||||||
COPY . . | ||||||||||||||
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn \ | ||||||||||||||
gabalafou marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
yarn install --network-timeout 600000 && \ | ||||||||||||||
yarn install --immutable --network-timeout 600000 && \ | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the --immutable flag here as a precaution. The Docker build will fail if the Yarn install process would result in a different yarn.lock file, which could happen for example if two different versions of Yarn are used. |
||||||||||||||
if [[ ! -f ".env" ]]; then mv .env.example .env; fi; | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
|
||||||||||||||
EXPOSE 8000 | ||||||||||||||
|
||||||||||||||
CMD [ "yarn", "webpack-dev-server", "--port", "8000" ] | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command doesn't actually exist anymore but it was never updated. Probably because the image is never run with this default command but rather a command override is supplied by Docker Compose. |
||||||||||||||
CMD [ "yarn", "run", "start:ui" ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ services: | |
|
||
conda-store-ui: | ||
build: . | ||
command: "yarn run start:ui --port 8000 --history-api-fallback" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't actually pass these options this way. |
||
command: "yarn run start:ui" | ||
profiles: | ||
- local-dev | ||
ports: | ||
|
@@ -91,7 +91,8 @@ services: | |
condition: service_healthy | ||
platform: linux/amd64 | ||
volumes: | ||
- .:/usr/src/app | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the real source of the "node_modules state file not found" error, not the Yarn version |
||
- ./src:/usr/src/app/src | ||
- ./style:/usr/src/app/style | ||
Comment on lines
+94
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are really the only folders that can be watched for hot-reloading. Mounting everything was causing the .env file (which gets copied in the build step, see the Dockerfile) to go missing. |
||
healthcheck: | ||
test: | ||
["CMD", "curl", "--fail", "http://localhost:8000"] | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,8 +6,9 @@ channels: | |||||
- conda-forge | ||||||
dependencies: | ||||||
- python=3.10 | ||||||
- yarn>=4.4.0 | ||||||
- nodejs>=18.0 | ||||||
# Match the version of Node.js defined for the Conda dev environment (environment_dev.yml). | ||||||
gabalafou marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
# Also, do not install Yarn separately, use Corepack (comes with Node.js). | ||||||
- nodejs=18.18 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
but why? package.json has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking about doing that in a follow-up PR, hence: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, just saw your comment on that issue (#416). Since I'm already neck-deep in all of this, I'll go ahead and update Node |
||||||
- pytest | ||||||
- pip | ||||||
- pip: | ||||||
|
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.
Not needed for Yarn classic (v1)