Skip to content

Commit

Permalink
feature: node example config via sed (#23)
Browse files Browse the repository at this point in the history
* feature: node example config via sed

* ref: remove local.json

* fix: rename ENV for local docs ip

* fix: master branch for example

* fix: revert service example name

* feature: readme

* ref: DOCSERVER_NETWORK_NAME
  • Loading branch information
askonev authored Jun 28, 2024
1 parent d8b00f3 commit dfe2403
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM node:10-buster
FROM node:14.21.3-buster

ARG build_branch=master

RUN git clone --depth=1 --recursive --shallow-submodules -b $build_branch https://github.com/ONLYOFFICE/document-server-integration.git
ENV DOCSERVER_NETWORK_NAME=''
ENV DOCS_PORT='8008'

ENV PORT=80

ARG BUILD_BRANCH=master

RUN git clone --depth=1 --recursive --shallow-submodules -b $BUILD_BRANCH https://github.com/ONLYOFFICE/document-server-integration.git
WORKDIR /document-server-integration/web/documentserver-example/nodejs/

RUN sed -i "s/documentserver/$DOCSERVER_NETWORK_NAME:$DOCS_PORT/" config/default.json
RUN sed -i "s/\"port\".*,/\"port\"\: ${PORT},/" config/default.json

RUN npm install
ENV NODE_CONFIG_DIR="./config"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Documentserver Nodejs Example Docker

## Setup

1. Replace `${REPLACE_WITH_IP}` in `local.json` with
1. Replace `ENV DOCS_ADDRESS=''` in `Dockerfile` with
your real ip (external, or local like `http://192.168.3.155`)
2. `docker compose build ds-test-example`
3. Edit `docker-compose.yml` to specify version of DocumentServer you want to setup
4. `docker compose up`
5. Open ip from step 1 in browser

Please make sure not to use `http://localhost` on any steps,
>Please make sure not to use `http://localhost` on any steps,
it may cause `File Download` error and other troubles
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.7"
services:
documentserver:
image: onlyoffice/documentserver-ee
Expand All @@ -13,5 +12,3 @@ services:
build: .
ports:
- "80:80"
volumes:
- ./local.json:/document-server-integration/web/documentserver-example/nodejs/config/local.json
11 changes: 0 additions & 11 deletions local.json

This file was deleted.

0 comments on commit dfe2403

Please sign in to comment.