Clarifications Regarding Deploying Discourse Docker Image on AWS ECS

AI-generated summary

Clarifications Regarding Deploying Discourse Docker Image on AWS ECS

A user, trying2survive, is seeking advice on deploying the Discourse Docker image on AWS ECS (container service). Despite successfully running Discourse on a standalone EC2 server with a separate PostgreSQL RDS instance and ElastiCache for Redis cluster, they encounter Exit Code 1 errors when trying to deploy on ECS.

pfaffman notes that this is an unsupported install, but offers guidance. They suggest passing all ENV variables to ECS containers using ./launcher start-cmd to print the necessary variables. The app.yml file is only used to build the image, and these variables are not embedded in the container. pfaffman is confident that passing these ENV variables will resolve the issue.

Hello,

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 - #18 by trying2survive and got the same answer. :wink: