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.38k stars 475 forks source link

Can not edit file in example after installing by docker. #676

Closed t-anh closed 10 months ago

t-anh commented 10 months ago

Hi all,

Base on installation guide, i have installed onlyoffice Docs Deverlopment Server by docker as following steps.

sudo docker run -i -t -d -p 9080:80 --restart=always \ -v /Users/user1/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \ -v /Users/user1/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ -v /Users/user1/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \ -v /Users/user1/onlyoffice/DocumentServer/db:/var/lib/postgresql -e JWT_SECRET=my_jwt_secret onlyoffice/documentserver-de

After that i access http://localhost:9080/welcome/ and run 2 command at "Testing before integration"

sudo docker exec eaf7f9327611 /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string' sudo docker exec eaf7f9327611 sudo sed 's,autostart=false,autostart=true,' -i /etc/supervisor/conf.d/ds-example.conf

And go to test example at http://localhost:9080/example/ At example page, I can upload and download file. but when edit file it display the following messages.

The document could not be saved Download failed

Please help me fix this issue.

igwyd commented 10 months ago

Hi @t-anh, it's because docker inside the container resolves to the localhost container's IP address, you should use IP address instead of localhost.

t-anh commented 10 months ago

@igwyd Thank you for you quick answer. Now i can edit file after using IP address.

mr-xiangxu commented 9 months ago

got the same issue while not using localhost.

version: '3.8'
services:
  onlyoffice-document-server:
    container_name: onlyoffice-document-server
    image: onlyoffice/documentserver:latest
    restart: always
    environment:
      - JWT_SECRET=secret
    ports:
      - '13080:80'
      - '13443:443'
    volumes:
      - document_data:/var/www/onlyoffice/Data
      - document_log:/var/log/onlyoffice
      - ../cert.pem:/var/www/onlyoffice/Data/certs/tls.crt
      - ../key.pem:/var/www/onlyoffice/Data/certs/tls.key
      - ../dhparam.pem:/var/www/onlyoffice/Data/certs/dhparam.pem

volumes:
  document_data:
  document_log:

issue-onlyoffice

BTW, downloading the file is working fine