Skip to content

Improve tcp server#27

Merged
theyoyojo merged 5 commits into
masterfrom
improve_tcp_server
Mar 18, 2024
Merged

Improve tcp server#27
theyoyojo merged 5 commits into
masterfrom
improve_tcp_server

Conversation

@charliemirabile

@charliemirabile charliemirabile commented Mar 16, 2024

Copy link
Copy Markdown
Contributor

Substantial cleanup to pop/smtp/tcp_server code.

Support for additional contexts that are container images (especially
local ones) varies between compose implementations, so just mounting the
source code in and building it is a better option.
Now that pop and smtp are building the tcp_server code directly
instead of pulling the binary from a container image, there is no
need to have the tcp_server container.

Fixes #26. if the container doesn't exist, it certainly can't
produce any error messages...
@charliemirabile charliemirabile marked this pull request as ready for review March 17, 2024 16:42
Since the primary consumers are building the server themselves, letting them
configure the default means they need less configuration at runtime

as it turns out, this also fixes #18, and even better prevents that kind error
where the default port could mismatch between documentation (-h output) and code
categorically since the value of the DEFAULT_PORT macro is now the one and only
source of truth.
By setting the default port to the desired value when building, we
can avoid needing to specify it with `-p` on the entrypoint cmdline.

This has an infinitesimal positive effect on startup time (since the
tcp server no longer has to parse the `-p` option or its argument),
but more importantly, it opens the door to being able to specify the
port that the servers will listen on via a build time argument. Which
was previously impossible because there is no way to resolve an ARG value
in an `ENTRYPOINT` command other than to make it part of the environment
and rely on a shell to do the subtition which isn't an option in a
container without a shell (i.e. `FROM scratch`) like pop/smtp.

@theyoyojo theyoyojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

paradigm shift achieved

Comment thread container-compose-dev.yml
Comment thread container-compose-staging.yml
Comment thread tcp_server/Makefile
Comment thread pop/Containerfile
Comment thread smtp/Containerfile
@theyoyojo theyoyojo merged commit 7164762 into master Mar 18, 2024
@theyoyojo theyoyojo deleted the improve_tcp_server branch March 18, 2024 20:39
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.

2 participants