Re:Deploy from local to production (self-hosted)
by xandrius on Saturday March 08, 2025 @03:58PM
(#43303450)
Exactly, for over 4 years I've been using my trusty 10 lines of bash (most of them is confirmation) to deploy in seconds and with 0 downtime. I should probably opensource it, lol
[ Parent
| on HN ]
Re:Deploy from local to production (self-hosted)
by Wilduck on Saturday March 08, 2025 @05:13PM
(#43304028)
I know you're joking a little, but I personally would love to see them! I'm very interested in how people manage simple deploys.
Re:Deploy from local to production (self-hosted)
by tbocek on Sunday March 09, 2025 @04:12AM
(#43307186)
Here is mine, I have a docker compose file locally, and this deploy.sh script deploy to my remote machine. That also means that my remote machine is building the image. And I have not found a good solution for secrets/env files yet:
#!/usr/bin/env bash
export DOCKER_HOST="ssh://username@host:port"
docker compose up -d --build
Re:Deploy from local to production (self-hosted)
by xandrius on Sunday March 09, 2025 @08:49AM
(#43308669)
For secrets, just literally have an ssh command which reads the local .env file and uses them to start the server with them as arguments/env vars.
Re:Deploy from local to production (self-hosted)
by _-_-__-_-_- on Sunday March 09, 2025 @06:22PM
(#43314531)
I want to do something similar, but I have multiple compose files, one per project, I haven’t figured out how to script this yet in subfolders.
Re:Deploy from local to production (self-hosted)
by mdaniel on Monday March 10, 2025 @11:41AM
(#43321784)
huh, TIL - I had never seen a non-(unix|https) version of DOCKER_HOST
time="2025-03-10T08:39:06-07:00" level=debug msg="commandconn: starting ssh with [-o ConnectTimeout=30 -T -l ec2-user -- ip-10-0-2-3 docker system dial-stdio]"
and I guess I could be forgiven since $(docker system dial-studio --help) says nothing
Re:Deploy from local to production (self-hosted)
by leosanchez on Sunday March 09, 2025 @12:01PM
(#43310353)
Do you use symlinks to achieve 0 downtime ? Assuming it is a systemd service ?.
If possible could you share gist of that script ?