0 down time deployment with GITLAB CI/CD && Docker

1. Caddy version:

v2.5.1 h1:bAWwslD1jNeCzDa+jDCNwb8M3UJ2tPa8UZFFzPVmGKs=

2. How I installed, and run Caddy:

I run caddy with docker

a. System environment:

Rocky 8

Hello,

I wish to develop a 0 downtime deployment using GITLAB CI/CD, and I thaught I had the dream command using

caddy reverse-proxy -from https:// to docker-container:9000

But I already have an instance of caddy running at port 80/443 which reverse other applications.

Any clues how I can achieve this with caddy ?

Thank you

That’s a pretty old version. Please upgrade to v2.6.2.

That command is only meant to be used for quick local development. You shouldn’t use it in production.

You’ll need to elaborate. I’m not sure I understand your goal here. Just saying “zero downtime” is not clear enough.

Then why not use that Caddy to proxy whatever?


Do not remove any parts of the help topic template. It’s there for a reason. It’s a forum rule to completely fill it out. We need as much information as possible about your setup and what you’re trying to achieve to be able to help.

Hello, thank you for the answer.

I’ve a running caddy server bind to 80/443.
The server is doing many reverse proxy over docker container.

The problem I’m facing is that during deployment I’ve to shutdown the container before updating it and then restart it.

I’m looking for a solution to update caddy config dynamicaly to switch the reverse proxy:

Example : Let’s say I’ve a running container named example-1, and caddy which reverse https://example.com to example-1:9000.

I’d like to deploy example-2, and when fully deployed update caddy to reverse proxy https//example.com to example-2:9000, and then shutdown example 1.

I know I can achieve such behavior by manipulating caddy files with sh scripts, but I was wondering and there was some magical stuff in caddy I don’t know about which can help me.

Hope it’s clear enough,

Have a good day,

Best regards,

Nicolas

Maybe you’re looking for GitHub - lucaslorentz/caddy-docker-proxy: Caddy as a reverse proxy for Docker

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.