# Running Discourse docker image in the environment on Amazon EC2 Container Service

**URL:** https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352
**Category:** Self-hosting
**Tags:** hosting
**Created:** [6월 29, 2017, 7:28오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352 "2017-06-29T19:28:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![golden\_eagle](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@golden\_eagle](https://meta.discourse.org/u/golden_eagle)
#### Post date: [6월 29, 2017, 7:28오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/1 "2017-06-29T19:28:33Z")

</div>

I have installed discourse. I have the docker image of discourse. Can anybody help me how to run Discourse docker image in the environment on Amazon EC2 Container Service?

I am getting few errors when I m trying to run the task. It’s getting stopped and giving me errors like this in my logs:

```
I, [2017-06-27T18:26:47.304367 #13] INFO -- : Loading --stdin
/pups/lib/pups/config.rb:23:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
from /pups/lib/pups/cli.rb:27:in `new'
from /pups/lib/pups/cli.rb:27:in `run'
from /pups/bin/pups:8:in `<main>'

```

---

<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: [6월 29, 2017, 7:41오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/3 "2017-06-29T19:41:56Z")

</div>

What was your process to getting the image there in the first place?

You did a local bootstrap, pushed the image to a registry somewhere, and is now trying to run that custom image?

Are all the volumes and env variables the same? Open ports, and db and redis servers accessible?

---

<div class="post-metadata">

### Author: ![golden\_eagle](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@golden\_eagle](https://meta.discourse.org/u/golden_eagle)
#### Post date: [6월 29, 2017, 7:57오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/4 "2017-06-29T19:57:05Z")

</div>

I will tell you what I did from start. Firstly I cloned the official discourse docker in my terminal. Then did

`./discourse-setup`

Then Edited containers/app.yml

`./launcher rebuild app`

Then pushed it on my git account.  
Made a repo on AWS EC2 container service.  
Then pushed the image that I had on my machine to the EC2 repo.  
Then In task definition, I added 2 containers in my task definition. One is discourse and the other is about pulling discourse docker image from the environment I have deployed on as an independent entity.

I was not sure about volumes so I didn’t add it in my task definition.

Here are details of port mapping of my discourse container:

```
Host Port	Container Port	Protocol
80 443 TCP

```

Port mapping for another container

```
Host Port Container Port Protocol
0 443 TCP

```

@Falco Can you tell me what I did wrong?

---

<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: [6월 29, 2017, 8:06오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/5 "2017-06-29T20:06:08Z")

</div>

> [@golden\_eagle](#):
>
> Then pushed it on my git account.

git? You want to push the resulting image to a compatible docker registry.

I really recommend using the [standard install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) on a standard EC2 Ubuntu.

---

<div class="post-metadata">

### Author: ![golden\_eagle](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@golden\_eagle](https://meta.discourse.org/u/golden_eagle)
#### Post date: [6월 29, 2017, 8:10오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/6 "2017-06-29T20:10:57Z")

</div>

I pushed it on my git so that I can have some back up if ever I loose my work on my machine. I have pushed the image on my AWS EC2 repo and that is a docker compatible. So we don’t have to worry about git at all. My main question is why is it not working for my EC2 environment?

@Falco

---

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [7월 3, 2017, 2:22오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/10 "2017-07-03T14:22:57Z")

</div>

I haven’t deployed Discourse on EC2 Container Service, but at least a few websites have done this with Elastic Beanstalk.

Some resources for you that I’ve stumbled upon in the past:

[https://github.com/ento/discourse\_aws](https://github.com/ento/discourse_aws)  
[http://stroupaloop.com/blog/discourse-setup-using-aws/](http://stroupaloop.com/blog/discourse-setup-using-aws/)

---

<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: [7월 3, 2017, 8:30오후 UTC](https://meta.discourse.org/t/running-discourse-docker-image-in-the-environment-on-amazon-ec2-container-service/65352/12 "2017-07-03T20:30:45Z")

</div>

Do not mention people’s names in this manner, please, or you will be suspended.
