Skip to content
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

Ship a Docker image of the whole thing #57

Closed
1 of 2 tasks
simonw opened this issue Nov 11, 2017 · 7 comments
Closed
1 of 2 tasks

Ship a Docker image of the whole thing #57

simonw opened this issue Nov 11, 2017 · 7 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Nov 11, 2017

The generated Docker images can then just inherit from that. This will speed up deploys as no need to pip install anything.

  • Ship that image to Docker Hub
  • Update the generated Dockerfile to use it
@simonw simonw modified the milestones: v1 stretch goals, Ship v1 Nov 11, 2017
@simonw simonw added the small label Nov 11, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 12, 2017

I have created a Docker Hub public repository for this: https://hub.docker.com/r/simonwillison/datasette/

@simonw simonw modified the milestones: Ship v1, v1 stretch goals Nov 13, 2017
@macropin
Copy link
Contributor

I'm happy to contribute this. Just let me know if you want a Dockerfile for development or production purposes, or both.

If it's prod then we can just pip install the source from pypi, otherwise for dev we'll need a requirements.txt to speed up rebuilds.

macropin added a commit to macropin/datasette that referenced this issue Nov 14, 2017
@macropin
Copy link
Contributor

Let me know if you'd like a PR. The image is usable as
docker run --rm -t -i -p 9000:8001 -v $(pwd)/db:/db datasette datasette serve /db/chinook.db

@simonw
Copy link
Owner Author

simonw commented Nov 14, 2017

I’m intrigued by this pattern:

https://github.com/macropin/datasette/blob/147195c2fdfa2b984d8f9fc1c6cab6634970a056/Dockerfile#L8

What’s the benefit of doing that? Does it result in a smaller image size?

@macropin
Copy link
Contributor

macropin commented Nov 14, 2017

The pattern is called "multi-stage builds". And the result is a svelte 226MB image (201MB for 3.6-slim) vs 700MB+ for the full image. It's possible to get it even smaller, but that takes a lot more work.

@simonw simonw modified the milestones: v1 stretch goals, v2: visualization edition Nov 14, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 14, 2017

Thanks for the explanation! Please do start a pull request.

@simonw simonw modified the milestones: v2: visualization edition, SQLite extensions + advanced JSON edition Nov 19, 2017
@simonw
Copy link
Owner Author

simonw commented Jun 28, 2018

Shipped to Docker Hub: https://hub.docker.com/r/datasetteproject/datasette/

I did this manually the first time. I'll set Travis up to do this automatically in #329

@simonw simonw closed this as completed Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants