1

I am working with two containers, one is for Caddy and one is for my application, both of them have been hosted on ECS Fargate, while my application is being pulled from ECR and the caddy image is being pulled from the official Docker repository. Both the containers are running fine but I am not sure how to access the Caddyfile for Caddy to serve SSL certificates to my application. I am able to get the standard Caddy webpage on container, but I need to somehow edit the Caddyfile for my use-case, could someone help me out? enter image description here

not-up
  • 41
  • 3

1 Answers1

0

According to the documentation for the Caddy image you are using, you should be mounting a /data folder and a /config folder. To do that with ECS on Fargate you need to create an Amazon Elastic File System, and then configure those mount points in your ECS task definition to use the EFS.


If you just want to specify the domain name, the documentation says you can simply pass a --domain parameter in the caddy command line. You would do that by editing the command in your ECS task definition.

I think you will have to configure more than that in order to get it to proxy requests to your other container though.


If you want to bundle your config file into the docker image that is being deployed, the documentation I linked also describes how you can create your own version of the image. You would do that locally, push the image to ECR, and then configure your ECS task definition to use that image instead of the standard Docker Hub image.

Mark B
  • 183,023
  • 24
  • 297
  • 295