mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #164] Add Docker #65
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jgroom33 on GitHub (Sep 25, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/164
it would be nice to have no install dependencies except docker.
expected behavior:
docker run -it -p 3000:3000 liyasthomas/postwoman:latest@jgroom33 commented on GitHub (Sep 25, 2019):
@liyasthomas
“Set up Automated Builds using GitHub and Docker Hub” by oleksii_y https://link.medium.com/AmD5s8x6f0
@liyasthomas commented on GitHub (Sep 25, 2019):
We're already making use of Travis CI for deployments. And I'm not experienced with docker. Would you care to explain docker CD advantages over other CIs?
@jgroom33 commented on GitHub (Sep 25, 2019):
the requirement is:
Publish an image to docker hub liyasthomas/postwoman
This account needs to exist so the image can be published there.
Then the image needs to be pushed there.
It's probably possible to do this with Travis, but it would require that to be setup in Travis. (Ie add a token for docker hub in Travis)
If docker hub is used, the process is easier. Just link your GitHub account from docker hub and it will watch for new releases. When a new release is published, it builds the image using the docker file and publishes it.
@liyasthomas commented on GitHub (Sep 25, 2019):
Cool! Let me do a background check on it and will let you know.
@liyasthomas commented on GitHub (Sep 25, 2019):
Closed by accident
@liyasthomas commented on GitHub (Sep 26, 2019):
@jgroom33
https://hub.docker.com/r/liyasthomas/postwoman
docker pull liyasthomas/postwoman@jgroom33 commented on GitHub (Sep 26, 2019):
Works great. Now just need to update the readme with:
docker run -p 3000:3000 liyasthomas/postwoman:latest@liyasthomas commented on GitHub (Sep 26, 2019):
Will do
@liyasthomas commented on GitHub (Sep 27, 2019):
@jgroom33 can you tell me why docker taking ~12 mins to build? Any optimizations you wanna suggest to
dockerfile?@jgroom33 commented on GitHub (Sep 27, 2019):
Where are you seeing the 12 minutes?
One of the things that would be good is to use an alpine image. They are much smaller (50M compared to 300M)
But that would only impact time if the root image is being downloaded each build.
I tried to use an alpine image originally, but the build failed.
@liyasthomas commented on GitHub (Sep 27, 2019):
Build duration was 12 mins.
Let me see if I could build with alpine rather than buster.
@jgroom33 commented on GitHub (Sep 27, 2019):
https://hub.docker.com/_/node/?tab=tags&page=1&name=alpine
@jls-tschanzc commented on GitHub (Dec 2, 2019):
Another improvement might be to use tini and switching from "npm run start" to directly executing the nuxt command. Just add "tini" to the
apk addcommand and then switch the CMD line with:Another nice to have feature might be a healthcheck, something like this:
I am not entirely sure how nuxt works and what dependencies it needs for runtime but maybe it could further slim down the resulting image by using a multi stage build so you would prepare everything for the
npm run buildin the first stage and run the build and then in the second stage you would only copy over the resulting build artefacts and setENV NODE_ENV productionas well as run onlynpm install --only=prod(IF all thedependenciesare even required for nuxt to run).@pidario commented on GitHub (Jan 13, 2020):
Sorry to comment under a closed issue, but in response to the previous comment I tried this Dockerfile:
I added tini as suggested and I also took the liberty to add ca-certificates.
I usually build this Dockerfile by using two different commands in sequence:
docker build --target builder -t builder-postwoman:latest .This image is used for caching purposes only and is not pushed to docker hub: note the tag is just builder-postwoman;
and then
docker build --target runner -t liyasthomas/postwoman:latest .This one instead has the usual tag you currently use and will be pushed to DH.
The image got shrunk down to 303MB, which is not bad for a nodejs application this large but probably you could still improve it by installing production dependencies only (for example you don't need test suite in production) as suggested by @jls-tschanzc