I did it with mysql, but used a docker-compose file to create a network and 
make sure both containers shared the same network:
version: "3"
services:

TracDB:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: trac
MYSQL_USER: tracuser
MYSQL_PASSWORD: pass
ports:
- "3306:3306"
command: --character-set-server=utf8 --collation-server=utf8_bin
networks:
- TracNet

Trac:
image: <your docker repos>/trac:latest 
restart: always
volumes:
# Mount the data migrated here after'trac-admin /var/trac/ hotcopy 
/home/ubuntu/TracBackup':
- /home/ec2-user/Trac/TracBackup/:/var/trac/<sitename>/
#Had to migrate to MySQL, so 1st launch of trac container had to run this 
command line
# command : sh -c "sleep 5 && trac-admin /var/trac/<sitename>/ convert_db 
"mysql://tracuser:password@TracDB:3306/trac"
ports:
- "8088:80"
depends_on:
- TracDB
networks:
- TracNet

networks:
TracNet:

On Wednesday, May 3, 2023 at 7:44:29 AM UTC-5 Markus Rosjat wrote:

> hi all,
>
>  i try to play around a little and hit a bump in the road with using 2 
> containers formy setup. I got one container for trac and one container for 
> postgresql. So far so good, if i try to connect with python from trac 
> container to the postgresql one i can query data as expected but if i try 
> to run tracd it tells me it can connect to the db ... here is my pseudo 
> connection string in my trac.ini
>
> database = postgres://dbuser:dbpassword@dockercontainer:5432/tracdb
>
> as i said if i pass that to psycopg2.connect as proper args i can get a 
> cursor and fetch data. If i try to do it with trac i get
>
> Trac Error
>
> TracError: Unable to check for upgrade of trac.db.api.DatabaseManager: 
> TimeoutError: Unable to get database connection within 10 seconds.
>
> So any pointers here would be nice.
>
> cheers 
>
> MArkus
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/d047a9c0-cdb5-48be-a18c-3ea650cc3f47n%40googlegroups.com.

Reply via email to