# Does rancher server and database can be separated in a docker-compose file?

**URL:** <https://forums.suse.com/t/does-rancher-server-and-database-can-be-separated-in-a-docker-compose-file/1682>\
**Category:** Rancher 1.x\
**Created:** [February 10, 2016, 12:57pm UTC](https://forums.suse.com/t/does-rancher-server-and-database-can-be-separated-in-a-docker-compose-file/1682 "2016-02-10T12:57:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clescot](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/clescot/32/317_2.png) [@clescot](https://forums.suse.com/u/clescot)\
**Post date:** [February 10, 2016, 12:57pm UTC](https://forums.suse.com/t/does-rancher-server-and-database-can-be-separated-in-a-docker-compose-file/1682/1 "2016-02-10T12:57:57Z")

</div>

Hi,  
i’m trying to backup to s3 the rancher database.  
One docker image can do the job : nickbreen/mysql-backup-cron  
i’ve tried to separate rancher server and database via a docker-compose file

> server:  
> image: rancher/server:v0.56.1  
> ports:  
> - “8080:8080”  
> environment:  
> - CATTLE\_DB\_CATTLE\_MYSQL\_HOST=database  
> - CATTLE\_DB\_CATTLE\_MYSQL\_PORT=3306  
> - CATTLE\_DB\_CATTLE\_MYSQL\_NAME=cattle  
> - CATTLE\_DB\_CATTLE\_USERNAME=cattle  
> - CATTLE\_DB\_CATTLE\_PASSWORD=secret

> links:  
> - database:database
> 
> database:  
> image: mysql:5.7.10  
> environment:  
> - MYSQL\_ROOT\_PASSWORD=supersecret  
> - MYSQL\_DATABASE=cattle  
> - MYSQL\_USER=cattle  
> - MYSQL\_PASSWORD=secret  
> expose:  
> - “3306”

but rancher server cannot access to database.  
docker version : 1.9.1  
docker-compose : 1.5.2  
have you any clue?

best regards,

Charles.

---

<div class="post-metadata">

**Author:** ![clescot](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/clescot/32/317_2.png) [@clescot](https://forums.suse.com/u/clescot)\
**Post date:** [February 11, 2016, 12:24pm UTC](https://forums.suse.com/t/does-rancher-server-and-database-can-be-separated-in-a-docker-compose-file/1682/2 "2016-02-11T12:24:00Z")

</div>

Hi,  
it seems to be a firewall issue.  
it works on my laptop.

best regards,

Charles.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [February 11, 2016, 8:35pm UTC](https://forums.suse.com/t/does-rancher-server-and-database-can-be-separated-in-a-docker-compose-file/1682/3 "2016-02-11T20:35:34Z")

</div>

Closed on February 11, 2016, 8:35pm UTC


