-
Notifications
You must be signed in to change notification settings - Fork 221
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
chore: dockerize development environment #1308
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2da620a:
|
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.
👌
WORKDIR / | ||
|
||
# Needed to compile some npm packages | ||
RUN apk add --no-cache bash python3 make g++ |
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.
which packages is this needed for? could we avoid them?
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.
python3
, make
, and g++
are required for iltorb
, a dependency of bundlesize
and rollup-plugin-filesize
, so it's dev only but the docker environment is meant for dev.
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.
ah, could we maybe have a look at updating those versions of bundlesize & rollup-plugin-filesize? if I remember it correctly in their later versions they rely on the node builtin brotli support
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.
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.
let's leave it as-is then for now @millotp :)
Dockerfile
Outdated
@@ -1,5 +1,5 @@ | |||
# Dockerfile | |||
FROM node:10-alpine | |||
FROM node:12.16.2-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.
can this be read from the nvmrc directly to not have a duplication?
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.
You're right it's totally possible, once renovate bot
will be installed it won't be an issue but it's a good idea for now.
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.
good to go
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.
This is great, thank you @millotp. It's almost good to go! 🚀
Dockerfile
Outdated
# Install the dependencies in the parent folder so they don't get overriden by the bind mount | ||
WORKDIR / | ||
|
||
# Needed to compile some npm packages |
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.
# Needed to compile some npm packages | |
# We need to install some dependencies for bundlesize (https://github.com/siddharthkp/bundlesize/pull/370) |
DOCKER_README.MD
Outdated
--env ALGOLIA_ADMIN_KEY_1 \ | ||
--env ALGOLIA_SEARCH_KEY_1 \ | ||
--env ALGOLIA_APPLICATION_ID_2 \ | ||
--env ALGOLIA_ADMIN_KEY_2 |
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.
--env ALGOLIA_ADMIN_KEY_2 | |
--env ALGOLIA_ADMIN_KEY_2 \ |
Thanks @Haroenv and @DevinCodes for the review ! |
The test is failing because the node docker container of circleCI that doesn't have the latest node versions is bundled with an outdated ssl implementation that resolves lets encrypt wrong, and doesn't allow yarn installs |
@Haroenv is there anything that we can do to resolve that? Or do we depend on CircleCI to resolve this in their image? |
I thought the |
What do you think of harmonising docker image in CI and this docker image in some later step? |
It might be possible to use this image in the CI yes, I need to check what the circle ci image does specifically, it might add some mandatory stuff. |
Ticket: DI-14
In the sake of harmonisation and to ease development, this PR adds a docker file in which you can run the test or lint the code, while using your normal IDE.
They are a few caveats, the first one is that because we mount the project to the
/app
folder, thenode_modules
are shared and slow down the execution by a lot. To avoid that, thenode_modules
are installed in the parent folder (the root) and an empty volumes is mounted to avoid copying the pacakges from the host.This works fine but prevent the modification of the packages, and the image must be rebuilt when some are added.
I used Docker Desktop in the readme to install docker because docker machine is deprecated and the code is archived.
To test the Dockerfile, follow the
DOCKER_README.MD
instructions and then runyarn test:unit
for example.