egregors / youtrack-docker-compose

Compose to create working YouTrack server
GNU General Public License v3.0
31 stars 11 forks source link

two youtrack instances example #14

Closed huglester closed 3 months ago

huglester commented 3 months ago

Hello

do you have an example of docker-compose.yml file with one traeffic and two instances of youtrack on same machine?

Thanks

egregors commented 3 months ago

Hi! It looks like you can't do that. JB made YouTrack stateful. The app container contains data store within with possibility to make mapping to host machine. That means, if you run a few YouTrack instances with the same mapping, they will rewrite each other's changes.

The YouTrack image is a stateful container. This allows the databases, log files, configuration files, and application data to be stored and maintained even if the container is restarted or moved to a different host.

To be sure, you can check official documentation of YouTrack out: https://www.jetbrains.com/help/youtrack/server/youtrack-docker-installation.html#create-and-configure-directories

huglester commented 3 months ago

But editing .yml file I could add second row of youtrack2 image

with different volumes.

I believe it should be possible, just the configuration issue

egregors commented 3 months ago

Yep, in this case, you can do that for sure. Looks like I got your question in the wrong way. I thought you want to make some sort of scaling (running N+1 instances of YouTrack with the same state store).

I'll check, if I can add multiple YouTrack example in the repo.

egregors commented 3 months ago

So, you generally can do that by setting different VIRTUAL_HOSTs.

  1. Change your docker-complose to smth like this:
    
    version: "3.3"

services:

traefik: image: "traefik:v2.2" container_name: "traefik" command:

  1. Add VIRTUAL_HOST_1 and VIRTUAL_HOST_2 into .env
huglester commented 3 months ago

Thanks a lot!