# Move from standalone container to separate web and data containers

**URL:** https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413
**Category:** Sysadmins
**Tags:** docker, how-to, advanced-setup, two-container
**Created:** [May 29, 2015, 2:12pm UTC](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413 "2015-05-29T14:12:22Z")
**Posts on this page:** 1
**Showing post:** 27

<div class="post-metadata">

### Author: ![dfriestedt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dfriestedt](https://meta.discourse.org/u/dfriestedt)
#### Post date: [November 10, 2019, 5:18pm UTC](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413/27 "2019-11-10T17:18:29Z")

</div>

I’m trying to implement the separate containers, but with a remote database. I’ve followed these instructions above and the [howto](https://meta.discourse.org/t/running-discourse-with-a-separate-postgresql-server/46375) for setting up a remote postgres DB. The setup works, but I’m wondering why there are two identical references (under web\_only and data) to the same database. It makes me believe I’m doing something wrong and the web\_only container is not even using the data container.

Am I doing this correctly?

Here is my setup.

Under the web\_only.yml I added:

```
  DISCOURSE_DB_SOCKET: ''
  DISCOURSE_DB_USERNAME: REMOVE
  DISCOURSE_DB_PASSWORD: REMOVE
  DISCOURSE_DB_HOST: xxx.ondigitalocean.com
  DISCOURSE_DB_NAME: REMOVE
  DISCOURSE_DB_PORT: 25060
  DISCOURSE_DB_BACKUP_PORT: 25060
  DISCOURSE_REDIS_HOST: data

```

under data.yml

I removed postgres.template.yml

```
templates:
# - "templates/postgres.template.yml"
  - "templates/redis.template.yml"

```

I also added the following:

```
env:
  # ensure locale exists in container, you may need to install it
  LANG: en_US.UTF-8
  DISCOURSE_DB_USERNAME: REMOVE
  DISCOURSE_DB_PASSWORD: REMOVE
  DISCOURSE_DB_HOST: REMOVE.ondigitalocean.com
  DISCOURSE_DB_NAME: REMOVE
  DISCOURSE_DB_PORT: 25060
  DISCOURSE_DB_BACKUP_PORT: 25060

```

---

_[View the full topic](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413)._
