# Can not connect to Tryton using docker compose

**URL:** <https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240>\
**Category:** System Administrator\
**Tags:** docker\
**Created:** [January 25, 2025, 7:52pm UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240 "2025-01-25T19:52:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![florin](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/91b2a8/32.png) [@florin](https://discuss.tryton.org/u/florin)\
**Post date:** [January 25, 2025, 7:52pm UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/1 "2025-01-25T19:52:25Z")

</div>

![image](https://discuss-cdn.tryton.org/uploads/default/original/2X/c/c6fc6d7c60bdd27b7c33e9954765afdf5b71e0b0.png)

```auto
curl https://foss.heptapod.net/tryton/tryton-docker/-/raw/branch/default/compose.yml -o compose.yml
docker compose -f compose.yml -p tryton up

```

for some odd reason the compose file dont provide a database, and docker was supposed to remove the “works on my machine”

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [January 25, 2025, 9:05pm UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/2 "2025-01-25T21:05:36Z")

</div>

Please provide the logs of the docker compose

---

<div class="post-metadata">

**Author:** ![florin](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/91b2a8/32.png) [@florin](https://discuss.tryton.org/u/florin)\
**Post date:** [January 25, 2025, 10:13pm UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/3 "2025-01-25T22:13:56Z")

</div>

here my fixed version, removing :- from the variables did the trick

```auto
services:
  server:
    image: tryton/tryton:${VERSION}
    environment:
      - DB_PASSWORD=${DB_PASSWORD}
    ports:
      - "8000:8000"
    volumes:
      - "tryton-data:/var/lib/trytond/db"
    command:
      - /bin/bash
      - -c
      - |
        (until echo > /dev/tcp/$${DB_HOSTNAME:=$${POSTGRES_PORT_5432_TCP_ADDR:='postgres'}}/$${DB_PORT:=$${POSTGRES_PORT_5432_TCP_PORT:='5432'}}; do sleep 0.5; done) 2>/dev/null
        echo "${PASSWORD}" > /tmp/.passwd
        TRYTONPASSFILE=/tmp/.passwd /entrypoint.sh trytond-admin -d "${DB_NAME}" --all --email "${EMAIL}" -vv
        if command -v uwsgi &>/dev/null; then uwsgi --ini /etc/uwsgi.conf; else gunicorn --config=/etc/gunicorn.conf.py; fi
    depends_on:
      - postgres
  cron:
    image: tryton/tryton:${VERSION}
    environment:
      - DB_PASSWORD=${DB_PASSWORD}
    volumes:
      - "tryton-data:/var/lib/trytond/db"
    command:
      - /bin/bash
      - -c
      - |
        (until echo > /dev/tcp/tryton/8000; do sleep 0.5; done) 2>/dev/null
        trytond-cron -d "${DB_NAME}"
    depends_on:
      - postgres
      - server
  postgres:
    image: postgres:${PG_VERSION}
    environment:
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_DB=${DB_NAME}
    volumes:
      - "postgres-data:/var/lib/postgresql/data"

volumes:
  postgres-data:
  tryton-data:

```

.env file

```auto
# Tryton image
VERSION=latest

# environment
DB_PASSWORD=your_db_test

# database
DB_NAME=tryton_test
DB_HOSTNAME=postgres
DB_PORT=5432

# Tryton admin settings
PASSWORD=admin_test
EMAIL=<-removed->

# PostgreSQL version
PG_VERSION=latest

```

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [January 25, 2025, 11:48pm UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/4 "2025-01-25T23:48:29Z")

</div>

I filled [Allow to pass empty email to admin command line (#13837) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/13837)

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [January 26, 2025, 12:38am UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/5 "2025-01-26T00:38:36Z")

</div>

A post was split to a new topic: [How to install external module to Docker image](https://discuss.tryton.org/t/how-to-install-external-module-to-docker-image/8241)

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [January 27, 2025, 12:38am UTC](https://discuss.tryton.org/t/can-not-connect-to-tryton-using-docker-compose/8240/6 "2025-01-27T00:38:44Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
