Skip to content

Conversation

@akalipetis
Copy link
Contributor

@akalipetis akalipetis commented Dec 12, 2016

  1. Bump Node version to 6.9 - the latest LTS
  2. Include the cpio binary, used during building
  3. Ignore node_modules and .git directories for faster builds
  4. Run the tests and build during the image build, to make sure the image is not built if these break
  5. Make npm run dev the default command
  6. Add an entrypoint to automatically install Node modules if they do nott exist

Signed-off-by: Antonis Kalipetis [email protected]

Based on #402 - since it uses the npm run dev script.

@akalipetis akalipetis changed the title Improve the package.json scripts Improve the Docker image Dec 12, 2016
@akalipetis akalipetis force-pushed the docker-enhancement branch 2 times, most recently from e8e53ae to d84accc Compare December 12, 2016 14:52
entrypoint.sh Outdated
@@ -0,0 +1,8 @@
#! /bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Can this be inlined into Dockerfile or something? Seems a bit messy to have a file in root that just runs npm install.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we can run npm install "on building" of image by using the node:6.9.2-onbuild image instead.

I agree that the entrypoint.sh in the root of the project kinda bloats it. I somehow missed it before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only helps during development - @parisk the on-build image flavor will still not work since we use volumes to mount the code inside the container.

We can just omit this and improve our docs - users should do docker-compose run --rm web npm install && docker-compose up the first time they want to spin up the project.

I'm 👍 with that, just let me know if you're Ok with this approach and I'll do a quick update.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it work if we inlined the ENTRYPOINT into the Dockerfile?

ENTRYPOINT "[ ! -d node_modules ] && npm install; $@"

Or something like the above?

1. Bump Node version to 6.9 - the latest LTS
2. Include the `cpio` binary, used during building
3. Ignore node_modules and .git directories for faster builds
4. Run the tests and build during the image build, to make sure the image is not built if these break
5. Make npm run dev the default command
6. Add an entrypoint to automatically install Node modules if they do nott exist

Signed-off-by: Antonis Kalipetis <[email protected]>
Signed-off-by: Antonis Kalipetis <[email protected]>
@akalipetis
Copy link
Contributor Author

Rebased with master and fixes an issue with EOL characters.

@Tyriar
Copy link
Member

Tyriar commented Dec 29, 2016

LGTM, I'm no authority on docker though 😄

This allows for reproducible builds.
Also, fix Dockerfile to first build and then run tests and a typo in the entrypoint.

Thanks @BenHall for reporting the issue with the Docker build!
Copy link
Contributor

@parisk parisk left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@akalipetis akalipetis merged commit 445728b into xtermjs:master Dec 30, 2016
@Tyriar Tyriar modified the milestone: 2.3.0 Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants