# Has anyone successfully gotten Discourse running in AWS ECS / similar?

**URL:** https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694
**Category:** Development
**Created:** [15 februari 2020 om 17:54 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694 "2020-02-15T17:54:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lktmxjv](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lktmxjv](https://meta.discourse.org/u/lktmxjv)
#### Post date: [15 februari 2020 om 17:54 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/1 "2020-02-15T17:54:38Z")

</div>

I’ve read threads like [this](https://meta.discourse.org/t/can-discourse-ship-frequent-docker-images-that-do-not-need-to-be-bootstrapped/33205) and others, and it seems like to date, there’s no easy way to pop a Discourse image into something like ECS, or GKE or whatever container orchestration you like and have it work easily…

I use Terraform to manage an Elasticache cluster, an RDS instance, and an ECS cluster. I just want to be able to say, “Here’s my Discourse image, and here are the environment variables to connect to Postgres, Redis, SMTP, etc.”

Does anything like this exist in 2020? It seems like in all the conversations around this topic previously, no satisfying resolution was reached, and we’re still stuck with Discourse’s custom scripts that defy container conventions and break compatibility with the idiomatic way people use containers…

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [15 februari 2020 om 18:17 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/2 "2020-02-15T18:17:13Z")

</div>

I replied a similar question two days ago

> [@Looking for Production Discourse Instructions](https://meta.discourse.org/t/looking-for-production-discourse-instructions/68096/8):
>
> Yes and that is the way to go. They bought bad crystal balls to predict the future. Told em to buy better ones for the next project joy Being serious, like you asked it’s easy to save the resulting image in a container registry and deploy it afterwards using the tool you like the most. And since you can run said container using some bash scripts, puppet, chef, ansible, terraform, backed into the AMI, user-data script, docker swarm, docker compose, kubernetes, capistrano, AWS ECS or many o…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [15 februari 2020 om 20:01 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/3 "2020-02-15T20:01:59Z")

</div>

> [@lktmxjv](#):
>
> Here’s my Discourse image, and here are the environment variables to connect to Postgres, Redis, SMTP, etc.

This is an incorrect assumption. All of those are elements of Discourse, and need to be controlled by Discourse within its container to guarantee successful setup.

If you get into complex multiple container scenarios, that’s only _necessary_ for large customers with lots of $, and I’d refer you to our enterprise hosting service..

---

<div class="post-metadata">

### Author: ![lktmxjv](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lktmxjv](https://meta.discourse.org/u/lktmxjv)
#### Post date: [15 februari 2020 om 23:36 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/4 "2020-02-15T23:36:00Z")

</div>

> [@codinghorror](#):
>
> All of those are elements of Discourse, and need to be controlled by Discourse within its container to guarantee successful setup.

Why’s that require this weird bootstrap script that launches containers and acts as an orchestrator though?

Why can’t the Discourse image accept env variables and in its entrypoint reach out to all those resources and create the tables it needs, etc.? Other services / web apps that rely on external persistence tiers have been successfully containerized in this way. You just pop them into an ECS or EKS or whatever, tell them where to find the database, etc., and it all works great. Is this possible with Discourse?

> [@codinghorror](#):
>
> If you get into complex multiple container scenarios, that’s only _necessary_ for large customers with lots of $, and I’d refer you to our enterprise hosting service…

It’s because we’re the opposite—a non-profit org without tons of budget—that we want to keep things as cheap as possible by throwing all our enterprise apps onto a single AWS ECS host. But that requires that the individual apps are neatly containerized and can be defined as ECS task definitions, i.e., self-contained Docker images.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [15 februari 2020 om 23:51 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/5 "2020-02-15T23:51:47Z")

</div>

Well, sort of – given that Discourse easily fits into a $5/month VPS as a straightforward single Docker install image, I’m not sure squeezing a few pennies out of that number – with a massive increase in install difficulty and ongoing maintenance complexity – is really worth the hassle? Keep it simple!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [16 februari 2020 om 03:45 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/6 "2020-02-16T03:45:07Z")

</div>

As the above link describes, you can build containers and launch them with kubernetes. I’ve done GKE deployments for some clients who insisted on it because they were tied to the platform.

If your goal is saving money then a $5 to $10/month is the way to go.

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [19 februari 2020 om 14:02 UTC](https://meta.discourse.org/t/has-anyone-successfully-gotten-discourse-running-in-aws-ecs-similar/141694/7 "2020-02-19T14:02:56Z")

</div>

> [@lktmxjv](#):
>
> Why can’t the Discourse image accept env variables and in its entrypoint reach out to all those resources and create the tables it needs, etc.? Other services / web apps that rely on external persistence tiers have been successfully containerized in this way. You just pop them into an ECS or EKS or whatever, tell them where to find the database, etc., and it all works great. Is this possible with Discourse?

Our tools are optimized for the far and away most common user: small groups without specialized IT to manage container orchestration.

The necessary parts are available though if y’all need to go Full Cloud. The source repository to look at is:

[https://github.com/discourse/discourse\_docker](https://github.com/discourse/discourse_docker)

The `samples/web_only.yml` file therein shows how to use external resources.

The ` launcher` script is also capable of building a custom docker image with the `bootstrap` subcommand.
