Need dedicated support? Click here
Need dedicated support?
Click here

DocSpace building

Are there any guide on how to build the DocSpace from source?

OS: Windows

hi @taran :wave:t3:

Unfortunately, not yet. I can’t even tell you the timing.

I’m trying to figure it out myself.
I want to make some Front End changes.
So the code I have to modify is “packages/client”.
Inside there I see “Dockerfile”.
It seems to be ancient though:

FROM node:12
WORKDIR /usr/src/app

COPY package.json ./
COPY yarn.lock ./

RUN yarn install

COPY . .

RUN yarn build

EXPOSE 8080

CMD [ "yarn", "build:start" ]

It’s set to node:12, but requires node 18, also yarn.lock file is not there.
I also see “build:start” command, but there is no such command in package.json.
When I update node to node:18 and comment out the yarn.lock line,
when I:

docker build --tag client .

I get the following error:

 => ERROR [6/6] RUN yarn build                                                                                                                            1.1s
------
 > [6/6] RUN yarn build:
0.690 yarn run v1.22.19
0.725 $ yarn build:translations && NODE_OPTIONS=--openssl-legacy-provider webpack --mode production
0.968 $ node scripts/buildTranslations.js
1.020 node:internal/modules/cjs/loader:1080
1.020   throw err;
1.020   ^
1.020
1.020 Error: Cannot find module '@docspace/common/utils/beforeBuild'
1.020 Require stack:
1.020 - /usr/src/app/scripts/buildTranslations.js
1.020     at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
1.020     at Module._load (node:internal/modules/cjs/loader:922:27)
1.020     at Module.require (node:internal/modules/cjs/loader:1143:19)
1.020     at require (node:internal/modules/cjs/helpers:121:18)
1.020     at Object.<anonymous> (/usr/src/app/scripts/buildTranslations.js:2:21)
1.020     at Module._compile (node:internal/modules/cjs/loader:1256:14)
1.020     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
1.020     at Module.load (node:internal/modules/cjs/loader:1119:32)
1.020     at Module._load (node:internal/modules/cjs/loader:960:12)
1.020     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
1.020   code: 'MODULE_NOT_FOUND',
1.020   requireStack: [ '/usr/src/app/scripts/buildTranslations.js' ]
1.020 }
1.020
1.020 Node.js v18.17.1
1.034 error Command failed with exit code 1.
1.035 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1.065 error Command failed with exit code 1.
1.066 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
Dockerfile:11
--------------------
   9 |     COPY . .
  10 |
  11 | >>> RUN yarn build
  12 |
  13 |     EXPOSE 8080
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1

Is there a latest version of this Dockerfile I can get somewhere?

@taran

Please note that we do not provide support for source code changes on the forum ¯\__(ツ)_/¯
If you highly interested in that, please try to ask my colleagues on GitHib: ONLYOFFICE · GitHub

I’ve figured it out myself. But now I have another question. Why is it asking me for a license?

1 Like

oops
Thanks, @taran, we’ll fix it.
If you copied the repository, change the installation_type in the file: docspace/build/install/docker/.env

INSTALLATION_TYPE=ENTERPRISE >> INSTALLATION_TYPE=COMMUNITY

or when launching the yml file add:
INSTALLATION_TYPE=COMMUNITY docker-compose ?.yml up -d

Thanks Nikolas,

with your tip + few more modifications, I was able to compile everything and get it to run.

1 Like