Clarifications Regarding Deploying Discourse Docker Image on AWS ECS


I have been trying to run the Discourse Docker image on ECS (container service in AWS) for more than a week already so I thought of reaching out here for advise. When trying on my standalone EC2 server, Discourse is running fine. I created a separate PostgreSQL RDS instance and ElastiCache for Redis cluster for this.

To deploy in ECS, I push the created image to the ECR registry. Then, I create a task that pulls that image. Expected result is it should run the Discourse container (that’s working on my standalone EC2 server, also stopped the running container there). However, I just get Exit Code 1 errors.

I also observed the ./launcher start app command and it outputs a lot of “-e” which is already in app.yml. Are there any further “run” commands that must be done on ECS?

I have read this but I may just be missing a simple point: Can Discourse ship frequent Docker images that do not need to be bootstrapped?

Thank you!

First: This is an unsupported install. Mostly, if you’re not running a standard docker install, you’re on your own.

But that said, here is what I think you need to know:

You need to pass all of those ENV variables to your ECS containers. You can use ./launcher start-cmd to get it to print that stuff. The app.yml is used just to build the image. Those variables aren’t embedded in the container. I am pretty sure that if you do whatever to get those ENV variables passed to your container it’ll do what you want.

I’ve never done an ECS install, but it looks like I will soon. I’d be happy to know whether that works.

You also asked the same thing here: Aws deployed discourse is fetching assets from database url and got the same answer. :wink: