# Docker compose: Gitea Mysql timeout

**URL:** <https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543>\
**Category:** Install/Maintain/Configure\
**Created:** [July 8, 2023, 8:43pm UTC](https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543 "2023-07-08T20:43:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saar](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saar](https://forum.gitea.com/u/saar)\
**Post date:** [July 8, 2023, 8:43pm UTC](https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543/1 "2023-07-08T20:43:26Z")

</div>

Hello,  
I am having trouble with a simple setup for Gitea + mysql on my Synology nas.  
I had it working fine as individual containers previously but i wanted to use the new “Container Manager”, as it supports “docker compose” and makes the update of container easier.

I spent a day on this and it still fails, hence here i am.

Both containers are up and running.  
I can connect and load the setup page for Gitea, but when i press the install button it times out.  
All i can see is that somehow gitea container can’t talk to the mysql container… it just times out every time.

The resolved IP:PORT returned in the timeout message matchs the mysql container information and should work.

The mysql container is “/usr/sbin/mysqld: ready for connections”, so i guess it’s happy…

Both containers are on the same network and were created as a “project” with a docker compose yalm file.

Am i missing an obvious step ?

I would be gratefull if any one could test it on their side or tell me who to contact.  
Tried Docker discord, told me it looks good, it is likely a Gitea issue.  
Contacted Synology, still waiting.  
Here i am trying the Gitea side.

Thanks !

Here is the compose.yalm file used:

```auto
version: '3.5'

services:
  app:
    image: gitea/gitea:latest
    container_name: gitea-app
    environment:
      - GITEA __database__ DB_TYPE=mysql
      - GITEA __database__ HOST=db
      - GITEA __database__ NAME=gitea
      - GITEA __database__ USER=gitea
      - GITEA __database__ PASSWD=gitea
    restart: 'unless-stopped'
    volumes:
      - /volume1/docker/projects/gitea/data:/data
    ports:
      - "12022:22"
      - "12080:3000"
    depends_on:
      - db

  db:
    image: mysql:8
    container_name: gitea-mysql
    restart: 'unless-stopped'
    environment:
      - MYSQL_ROOT_PASSWORD=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=gitea
      - MYSQL_DATABASE=gitea
    volumes:
      - /volume1/docker/projects/gitea/mysql:/var/lib/mysql

```

---

<div class="post-metadata">

**Author:** ![saar](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saar](https://forum.gitea.com/u/saar)\
**Post date:** [July 9, 2023, 6:35am UTC](https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543/2 "2023-07-09T06:35:31Z")

</div>

I can confirm that it works if i hand create two seperate separate container, without using the Project option (compose), and link them afterwards myself.

So there is an issue with the Project (compose) approach where it configure a single network.  
Looks like a Synology docker issue, but can’t say for sure.

---

<div class="post-metadata">

**Author:** ![wxiaoguang](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/wxiaoguang/32/2280_2.png) [@wxiaoguang](https://forum.gitea.com/u/wxiaoguang)\
**Post date:** [July 9, 2023, 6:39am UTC](https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543/3 "2023-07-09T06:39:38Z")

</div>

Try to make them in the same network

```auto

networks:
  gitea:
    external: false
services:
  app:
    image: gitea/gitea:latest
    networks:
      - gitea
  db:
    networks:
      - gitea
```

---

<div class="post-metadata">

**Author:** ![saar](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saar](https://forum.gitea.com/u/saar)\
**Post date:** [July 9, 2023, 6:41am UTC](https://forum.gitea.com/t/docker-compose-gitea-mysql-timeout/7543/4 "2023-07-09T06:41:44Z")

</div>

Thanks, I already tried that and had the same result unfortunately.  
Actually docker compose will already create a default network for them if none is specified and assign it to the two of them.
