Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Improve docker #92

Merged
merged 4 commits into from
Dec 18, 2018
Merged

Improve docker #92

merged 4 commits into from
Dec 18, 2018

Conversation

nierdz
Copy link
Contributor

@nierdz nierdz commented Dec 11, 2018

  • mono is updated from 5.12 to 5.16
  • $DOMAIN is not mandatory anymore, this means you can start this container even if you don't provide $DOMAIN as environment variable. You'll only get a warning about it, then server.exe will be started.
    You can use docker-compose and maybe mount a volume with your own certificate.pfx instead.
  • apply some docker best practices as clean apt or include acme.sh in Dockerfile
  • update documentation to reflect these changes

Let me know if something isn't clear or if you want me to modify something.

nierdz added 4 commits December 11, 2018 14:47
- $DOMAIN is no mandatory anymore
- acme.sh is installed inside container directly
- apply some docker best practices
- replace tabs by soft spaces
- shellcheck compliant
- generate cert only if not present or if cert is invalid
@notgiven688
Copy link
Owner

Thank you @nierdz! Do you accept a small donation from the general fund?

@notgiven688 notgiven688 merged commit 8cc59ac into notgiven688:master Dec 18, 2018
@nierdz
Copy link
Contributor Author

nierdz commented Dec 20, 2018

Thank you @nierdz! Do you accept a small donation from the general fund?

Nope, I did it for myself and just wanted to share it for everyone.

I'm pulling about 35 H/s on a mid-2015 MacBook Pro using the WMP docker setup on a lightweightVPS. Thoughts on recompiling under the new mono version to eek out more?

I didn't see any major improvement using last version of mono but it's a good practice to stay up to date...

@nierdz nierdz deleted the improve-docker branch December 20, 2018 09:06
@ghost ghost mentioned this pull request Feb 25, 2019
@ghost
Copy link

ghost commented Feb 25, 2019

@nierdz about to give this a try as i had to hack entrypoint.sh last time to get things working without a www subdomain and—for some reason—my TLS cert didn't auto-renew as expected so my proxy started quietly failing.


if [[ ! -f "/root/.acme.sh/${DOMAIN}/${DOMAIN}.cer" ]] || ! openssl x509 -checkend 0 -in "/root/.acme.sh/${DOMAIN}/${DOMAIN}.cer"; then
# Generate SSL cert
/root/.acme.sh/acme.sh --issue --standalone -d "${DOMAIN}" -d "www.${DOMAIN}"
Copy link

Choose a reason for hiding this comment

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

Why would anyone want a cert on www for a proxy server? I think the second -d flag should be removed.

rm -rf /var/lib/apt/lists/* && \
git clone https://github.com/Neilpang/acme.sh.git /root/acme.sh && \
cd /root/acme.sh && \
git checkout 2.7.9 && \
Copy link

@ghost ghost Feb 25, 2019

Choose a reason for hiding this comment

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

Please externalize version to ENV on next update and, ideally, pull from release tarball as opposed to using Git. Here's how you can pull release tarball:

A nice to have also is a multi-stage build where binary is compiled in mono then dropped into a busybox container or similar for a microcontainer end-result. Ideally the final binary would be moved into a scratch container but cron is necessary to keep the cert up-to-date (though I doubt this will always be the case).

This should make the whole thing take up very small amounts of resources and more suitable for deployment on ARMv7 and other ARM-based architectures following a compile using mono.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants