# Convert working command-line docker to compose.yml

**URL:** <https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681>\
**Category:** Installation & Configuration\
**Created:** [March 13, 2023, 10:24am UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681 "2023-03-13T10:24:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3lt3r](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@b3lt3r](https://forum.collaboraonline.com/u/b3lt3r)\
**Post date:** [March 13, 2023, 10:24am UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/1 "2023-03-13T10:24:38Z")

</div>

I have no doubt I’m missing something obvious but after hours it eludes me. I have official nextcloud:fpm running in docker and wanted to add office. After much research it all works when I start my collabora container with this:  
docker run --name collabora -t -d -p 9980:9980 -e “domain=xxxxx.com” -e “server\_name=office.xxxxx.com” --restart no --cap-add MKNOD collabora/code  
I have configured NC to point at [https://office.xxxxx.com](https://office.xxxxx.com) and disabled cert verification as that’s all managed in haproxy elsewhere. All works great.

I have tried to convert that one line to a compose file but although it starts (what appears to be) identically, when I try to open an office file it just spins then times out.  
version: ‘2’  
services:  
collabora:  
image: collabora/code  
container\_name: collabora  
restart: “no”  
cap\_add:  
- MKNOD  
ports:  
- 9980:9980  
tty: true  
environment:  
- domain=xxxxx.com  
- server\_name=office.xxxxx.com

I have tried every combination of no "", only on the domain statement and with and without quotes.

As I said - I don’t doubt it’s me but this has beaten me to date 🙂

Sigh… In a moment of brilliance I have somehow broken what was working ☹ I will need to recreate my setup once again and retrace the steps

---

<div class="post-metadata">

**Author:** ![b3lt3r](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@b3lt3r](https://forum.collaboraonline.com/u/b3lt3r)\
**Post date:** [March 13, 2023, 3:47pm UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/2 "2023-03-13T15:47:12Z")

</div>

ok - after much time I am back where I was hours ago - situation the same - run works compose doesn’t. I’ve captured logs from both attempts and although there are a large number of lines even when it works (which seem strange) - the key seems to be multiple blocks like this in the compose logs:  
collabora | wsd-00001-00046 2023-03-13 15:15:36.232193 +0000 [docbroker\_003] ERR Failed to add session to [hxxx://fred.xxxxx.com:443/index.php/apps/richdocuments/wopi/files/35\_ocy7j2wq2ex0] with URI [hxxx://fred.xxxxx.com/index.php/apps/richdocuments/wopi/files/35\_ocy7j2wq2ex0?access\_token=a0ChrRWCI5MDSZll5j3lAlQOOiCZBWF9&access\_token\_ttl=1678756534000&permission=edit]: No acceptable WOPI hosts found matching the target host [[fred.xxxxx.com](http://fred.xxxxx.com)] in config.| wsd/DocumentBroker.cpp:2377

====================================  
editing the same file in the run initiated session gives me this (with other repeated read failed lines) but it retrieves and edits perfectly.  
wsd-00001-00039 2023-03-13 15:19:10.769783 +0000 [docbroker\_001] ERR Failed to lock docKey [hxxx://fred.xxxxx.com:443/index.php/apps/richdocuments/wopi/files/35\_ocy7j2wq2ex0] with session [00b] after downloading: | wsd/DocumentBroker.cpp:1009  
wsd-00001-00036 2023-03-13 15:19:12.908633 +0000 [websrv\_poll] ERR #33: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1136

---

<div class="post-metadata">

**Author:** ![b3lt3r](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@b3lt3r](https://forum.collaboraonline.com/u/b3lt3r)\
**Post date:** [March 17, 2023, 10:56am UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/3 "2023-03-17T10:56:20Z")

</div>

Found a(nother) random thread elsewhere which had a snippet using [aliasgroup1=domain.com](http://aliasgroup1=domain.com) - when I tried that with [aliasgroup1=office.domain.com](http://aliasgroup1=office.domain.com) it all burst into life. Still doesn’t look right with error messages in the log and it only works with one instance but it means I can put it in a single compose with the NC itself so “good enough”…

---

<div class="post-metadata">

**Author:** ![wwe](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/wwe/32/534_2.png) [@wwe](https://forum.collaboraonline.com/u/wwe)\
**Post date:** [March 18, 2023, 8:06pm UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/4 "2023-03-18T20:06:28Z")

</div>

I’m running CODE behind traefik reverse proxy… like this

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/collaboraonline/original/1X/c0ff8689f04ed41c8ddd0c59094e25c0cba4a2fe.png)

here is excerpt of working compose file

```auto
  collabora:
    image: collabora/code:22.05.10.1.1
    container_name: collabora
    restart: unless-stopped
    networks:
      - traefik_proxy
    expose:
      - "9980"
    environment:
      # https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html
      - aliasgroup1=${NEXTCLOUD1}
      - aliasgroup2=${NEXTCLOUD2}
      - aliasgroup3=${NEXTCLOUD3}
      - dictionaries=de_DE en_US es_ES ru
      - VIRTUAL_PROTO=http
      - VIRTUAL_PORT=9980
      - VIRTUAL_HOST=${COLLABORA_FQDN}
      - extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:user_interface.mode=compact --o:net.proto=IPv4 --o:hexify_embedded_urls=true --o:logging.level=warning
      - username=<code admin>
      - password=<code admin pwd>
    cap_add:
      - MKNOD
    tty: true
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik_proxy"
      - traefik.http.routers.collabora.entrypoints=web-secure
      - traefik.http.routers.collabora.rule=Host(`${COLLABORA_FQDN}`)
      - traefik.http.routers.collabora.tls=true
      - traefik.http.routers.collabora.tls.certresolver=letsencryptresolver
      - traefik.passHostHeader=true
      - traefik.http.routers.collabora.middlewares=secHeaders3@file
      - traefik.http.services.collabora.loadbalancer.server.port=9980
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

```

- variables with `${..}` are coming from `.env` file in the same directory. I use them often and in my eyes it’s good idea to put every moving part like version or passwords into this file ( 🙂 I see the example doesn’t strictly follow this advice ☹ )
- `labels:` are used for traefik revese proxy - in case you use another one you can omit them…

more details you can find here: [Docker Compose for Nextcloud + Collabora + Traefik? - #2 by wwe - office - Nextcloud community](https://help.nextcloud.com/t/docker-compose-for-nextcloud-collabora-traefik/127733/2?u=wwe)

---

<div class="post-metadata">

**Author:** ![b3lt3r](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@b3lt3r](https://forum.collaboraonline.com/u/b3lt3r)\
**Post date:** [March 19, 2023, 9:38am UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/5 "2023-03-19T09:38:50Z")

</div>

Thanks. That architecture is pretty much how I’m set up except I have haproxy where you have traefik.

Question - what is your aliasgroup pointing at? As I mentioned - when I tried with just the [domain.com](http://domain.com) it did not connect but when I specify [host.domain.com](http://host.domain.com) it works which seems to conflict with the docs.

Also trying to share one Collabora container with multiple NC:FPM instances would not work - bizarrely it seems like the first one to connect takes ownership and subsequent ones hang. I am “assuming” that sharing is the reason for having multiple alias groups to define permitted hosts, but it’s not clear to me.

Anyway - right or wrong, my current config works (for now) so I will tip-toe quietly away 🙂

---

<div class="post-metadata">

**Author:** ![wwe](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/wwe/32/534_2.png) [@wwe](https://forum.collaboraonline.com/u/wwe)\
**Post date:** [March 30, 2023, 11:59am UTC](https://forum.collaboraonline.com/t/convert-working-command-line-docker-to-compose-yml/1681/6 "2023-03-30T11:59:36Z")

</div>

regarding aliasgroup and multiple WOPI hosts you want to review this topic: [Important changes regarding COOL/CODE docker versions from v21.11.3.6 on (multiple domains setup) - 📄 Collabora - Nextcloud community](https://help.nextcloud.com/t/important-changes-regarding-cool-code-docker-versions-from-v21-11-3-6-on-multiple-domains-setup/137867)
