-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Docker container #24
Docker container #24
Conversation
on: | ||
push: | ||
branches: | ||
- main |
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.
main branch doesn't exist in this repository, so anyone could make an unprotected branch with push perms.
It should be removed, or a main branch should be created and protected.
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.
@bumi I'm not sure about your branch protection rules, does anyone without direct access to the main branch still have push access to this repo?
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.
secrets and such are not available to forks, so this will not be working when somebody forks the repo (which is what we want).
edit: but yeah, LnMe uses master
and not main
.
but I am also wondering if we need that on-push action? isn't it enough to do that for tags which then are the official releases?
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.
I'm using an on push action myself, it's free to run, and it allows testing a new version in Docker (and maybe fixing new bugs only appearing in Docker) before tagging it.
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.
if we want to keep building on push, then we must change "main" to "master" (we still use master as the master/main branch)
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.
It builds on both master and main, so it still works if you rename
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 I missed the master
in the line below. sorry. thanks.
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.
(though I have no plans to rename the branch and potentially break things.)
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.
Actually, branch could be left out so it also builds for WIP feature branches for testing. What do you think?
LGTM |
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.
Actually, this build should be conditional on the test suite passing.
This will prevent broken builds from being published.
Edit: No tests exist. Might want to fix that first.
Yes, sadly that's a problem. at this point we do not have automated tests. |
Tested & works. |
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.
How are configuration options passed in? that would be done when running the container? e.g. through docker-compose?
Yes, options get passed in as env vars through docker-compose |
|
||
COPY --from=builder /app/lnme /lnme | ||
|
||
EXPOSE 1323 |
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.
the PORT can be configured... should this then also be configurable (based on the LNME_LISTEN env variable) or is it a practice to NOT change the default port when using docker?
(I am not very experienced with docker)
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.
EXPOSE just exposes a port to other containers by default.
At runtime / in a higher level compose file you can expose and/or open-to-host any port you want.
This should be fine to use the default port. (It's semi-convention)
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.
thanks! 👍
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.
From the docker documentation
The
EXPOSE
instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published.
OK, I think this is cool. I can then also do something like: |
Sorry, I missed your comment. I'll add a note now. |
thanks so much! merging! |
The docker images build, but haven't been tested yet.
This adds very early docker container support. Once you merge this PR, builds will automatically happen on every push and tag and will be pushed to GitHub container registry.