Skip to content

Commit

Permalink
[develop] Fix Dockerfile. Allow branding command line params
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Oct 5, 2023
1 parent 7b0d4d3 commit 069829d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN apt-get update -y && \
if [ -s /etc/supervisor/conf.d/ds-example.conf ] ; then sed -i 's,autostart=false,autostart=true,' /etc/supervisor/conf.d/ds-example.conf; fi && \
if [ -s /app/ds/setup/config/supervisor/ds/ds-example.conf ] ; then sed -i 's,autostart=false,autostart=true,' /app/ds/setup/config/supervisor/ds/ds-example.conf; fi && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT python3 /var/www/onlyoffice/documentserver/build_tools/develop/run_build_js.py /var/www/onlyoffice/documentserver && /bin/sh -c /app/ds/run-document-server.sh
ENTRYPOINT python3 /var/www/onlyoffice/documentserver/build_tools/develop/run_build_js.py /var/www/onlyoffice/documentserver $@ && /bin/sh -c /app/ds/run-document-server.sh
23 changes: 23 additions & 0 deletions develop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,26 @@ docker exec -it CONTAINER_ID supervisorctl restart all
```

3)Open new file in browser

## Start server with additional functionality(addons)

To get additional functionality and branding you need to connect a branding folder,
additional addon folders and pass command line arguments

For example run with `onlyoffice` branding and
addons:`sdkjs-forms`, `sdkjs-ooxml`, `web-apps-mobile`

### docker run on Windows (PowerShell)

Check failure on line 200 in develop/README.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple headings with the same content [Context: "### docker run on Windows (Pow..."]

develop/README.md:200 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### docker run on Windows (Pow..."]

**Note**: Run PowerShell as administrator to fix EACCES error when installing
node_modules

```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $pwd/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $pwd/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $pwd/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $pwd/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost

Check failure on line 206 in develop/README.md

View workflow job for this annotation

GitHub Actions / markdownlint

Line length [Expected: 300; Actual: 597]

develop/README.md:206:301 MD013/line-length Line length [Expected: 300; Actual: 597]
```

### docker run on Linux or macOS

Check failure on line 209 in develop/README.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple headings with the same content [Context: "### docker run on Linux or mac..."]

develop/README.md:209 MD024/no-duplicate-heading/no-duplicate-header Multiple headings with the same content [Context: "### docker run on Linux or mac..."]

```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $(pwd)/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $(pwd)/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $(pwd)/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $(pwd)/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost

Check failure on line 212 in develop/README.md

View workflow job for this annotation

GitHub Actions / markdownlint

Line length [Expected: 300; Actual: 609]

develop/README.md:212:301 MD013/line-length Line length [Expected: 300; Actual: 609]
```
17 changes: 16 additions & 1 deletion develop/run_build_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

git_dir = sys.argv[1];

base.cmd_in_dir(git_dir + '/build_tools/', 'python3', ['configure.py', '--develop', '1'])
base.print_info('argv :'+' '.join(sys.argv))
base.cmd_in_dir(git_dir + '/build_tools/', 'python3', ['configure.py', '--develop', '1'] + sys.argv[2:])

config.parse()
config.parse_defaults()

if base.is_exist(git_dir + "/server/FileConverter/bin/fonts.log"):
base.print_info('remove font cache to regenerate fonts in external sdkjs volume')
Expand All @@ -31,6 +34,18 @@
if base.is_exist(git_dir + "/server/FileConverter/bin/DoctRenderer.config"):
base.print_info('replace DoctRenderer.config for external sdkjs volume')
base.generate_doctrenderer_config(git_dir + "/server/FileConverter/bin/DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")

addons = {}
addons.update(base.get_sdkjs_addons())
addons.update(base.get_web_apps_addons())
staticContent = ""
for addon in addons:
if (addon):
staticContent += '"/' + addon + '": {"path": "/var/www/onlyoffice/documentserver/' + addon + '","options": {"maxAge": "7d"}},'

if staticContent:
base.print_info('replace production-linux.json for addons'+staticContent)
base.replaceInFileRE("/etc/onlyoffice/documentserver/production-linux.json", '"static_content": {.*', '"static_content": {' + staticContent)

base.print_info('replace supervisor cfg to run docservice and converter from pkg')
base.replaceInFileRE("/etc/supervisor/conf.d/ds-docservice.conf", "command=node .*", "command=/var/www/onlyoffice/documentserver/server/DocService/docservice")
Expand Down

0 comments on commit 069829d

Please sign in to comment.