ONLYOFFICE / Docker-DocumentServer

ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
GNU Affero General Public License v3.0
1.37k stars 470 forks source link

HTTPS Site not starting in Docker Container onlyoffice-documentserver #729

Closed pthoelken closed 4 months ago

pthoelken commented 4 months ago

Do you want to request a feature or report a bug? Bug report

What is the current behavior? Starting the Docker Environment with the docker-compose.yml below.

onlyoffice-documentserver:
    image: onlyoffice/documentserver:latest
    container_name: onlyoffice-documentserver
    depends_on:
      - onlyoffice-postgresql
      - onlyoffice-rabbitmq
    environment:
      - ONLYOFFICE_HTTPS_HSTS_ENABLE=true
      - SSL_VERIFY_CLIENT=false
      - DB_TYPE=postgres
      - DB_HOST=onlyoffice-postgresql
      - DB_PORT=5432
      - DB_NAME=onlyoffice
      - DB_USER=onlyoffice
      - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
    ports:
      - '8084:80'
      - '5443:443'
    stdin_open: true
    restart: always
    stop_grace_period: 60s
    volumes:
       - /var/www/onlyoffice/Data
       - /var/log/onlyoffice
       - /var/lib/onlyoffice/documentserver/App_Data/cache/files
       - /var/www/onlyoffice/documentserver-example/public/files
       - /usr/share/fonts

  onlyoffice-rabbitmq:
    container_name: onlyoffice-rabbitmq
    image: rabbitmq
    restart: always
    expose:
      - '5672'

  onlyoffice-postgresql:
    container_name: onlyoffice-postgresql
    image: postgres:latest
    environment:
      - POSTGRES_DB=onlyoffice
      - POSTGRES_USER=onlyoffice
      - POSTGRES_HOST_AUTH_METHOD=trust
    restart: always
    expose:
      - '5432'
    volumes:
      - postgresql_data:/var/lib/postgresql

to use it in a ownCloud instance. The only thing what I changed was the https exposed port bc the ports was already blocked by another container.

I've started the enviroment and all actually all works fine but the https-site was not started in the onlyoffice-documentserver container. Just the 80 site. This is what you can see with the commands below.

netstat -tulpn from the container onlyoffice-documentserver here you can see, that only 80 is started.

root@ptl-srv-docker01:/srv/data/composing/owncloud# docker exec -it onlyoffice-documentserver /bin/bash
root@83c88a8c4486:/# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:32781        0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      425/nginx: master p
tcp6       0      0 :::8126                 :::*                    LISTEN      -
tcp6       0      0 :::8000                 :::*                    LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      425/nginx: master p
udp        0      0 0.0.0.0:8125            0.0.0.0:*                           -
udp        0      0 127.0.0.11:45118        0.0.0.0:*                           -

Checks from owncloud instance to reach 80 and 443 to onlyoffice-documentserver

root@ptl-srv-docker01:/srv/data/composing/owncloud# docker exec -it owncloud_server /bin/bash
root@77605387b5bb:/var/www/owncloud# telnet onlyoffice-documentserver 80
Trying 192.168.48.7...
Connected to onlyoffice-documentserver.
Escape character is '^]'.
^CConnection closed by foreign host.

root@77605387b5bb:/var/www/owncloud# telnet onlyoffice-documentserver 443
Trying 192.168.48.7...
telnet: Unable to connect to remote host: Connection refused

What is the expected behavior? 443 site on container onlyoffice-documentserver is not started. In this case I'm not able to use onlyoffice with ownCloud because ownCloud did not allow mixed connection types (ownCloud URL is HTTPS, onlyoffice URL would then be HTTP (this is mixed connection types))

Did this work in previous versions of DocumentServer? idk - I'm working with onlyoffice since today.

DocumentServer Docker tag: latest

Host Operating System: Debian 12 / Docker Engine

igwyd commented 4 months ago

Hello @pthoelken, the port 443 is not listening because you haven't added certificates, this is a guide how you can do that, after adding certificates restart docker compose and 443 will open.

pthoelken commented 4 months ago

This works for me, but opens another question from https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues/480

Rita-Bubnova commented 4 months ago

I close this issue. Feel free to comment or reopen it if you got further questions.