[Python] Using same code to access database in different containers

Discussão em 'Python' iniciado por Stack, Março 28, 2025.

  1. Stack

    Stack Membro Participativo

    I'm developing a small telegram bot+mini app in python that will access postgres database. I've already written some basic code for interacting with db for bot and it seems that mini app will be very similar. The code itself is a simply database.py file which is currently around 180-200 lines of code. I have no previous experience with docker but as far as I know it would be better to separate such things in different containers.

    So that brings two questions: Should I separate bot and webapp into two containers? If yes is there a way to use the same database.py file in different containers?

    Continue reading...

Compartilhe esta Página