Skip to content

Commit

Permalink
Add plugins packaging to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-antonyuk committed Oct 4, 2024
1 parent a183959 commit f9834bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install/docker/Dockerfile.app
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ RUN apt-get -y update && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/nodesource.gpg --import && \
chmod 644 /usr/share/keyrings/nodesource.gpg && \
apt-get -y update && \
apt-get install -y nodejs && \
apt-get install -y nodejs unzip && \
rm -rf /var/lib/apt/lists/*

ADD https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/git/refs/heads/${GIT_BRANCH} version.json
RUN git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \
git clone --recurse-submodules -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \
git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client && \
git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/docspace-plugins.git ${SRC_PATH}/plugins && \
git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/ASC.Web.Campaigns.git ${SRC_PATH}/campaigns

RUN cd ${SRC_PATH} && \
Expand All @@ -62,6 +63,7 @@ RUN cd ${SRC_PATH} && \
bash build-frontend.sh -sp "${SRC_PATH}" -ba "${BUILD_ARGS}" -da "${DEPLOY_ARGS}" -di "${DEBUG_INFO}" && \
bash build-backend.sh -sp "${SRC_PATH}" && \
bash publish-backend.sh -pc "${PUBLISH_CNF}" -sp "${SRC_PATH}/server" -bp "${BUILD_PATH}" && \
bash plugins-build.sh "${SRC_PATH}/plugins" && \
cp -rf ${SRC_PATH}/server/products/ASC.Files/Server/DocStore ${BUILD_PATH}/products/ASC.Files/server/ && \
rm -rf ${SRC_PATH}/server/common/* && \
rm -rf ${SRC_PATH}/server/web/ASC.Web.Core/* && \
Expand Down Expand Up @@ -352,6 +354,7 @@ FROM dotnetrun AS studio
WORKDIR ${BUILD_PATH}/studio/ASC.Web.Studio/

COPY --chown=onlyoffice:onlyoffice docker-entrypoint.py ./docker-entrypoint.py
COPY --from=base --chown=onlyoffice:onlyoffice ${SRC_PATH}/plugins/publish/ ${BUILD_PATH}/studio/plugins
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Web.Studio/service/ .

CMD ["ASC.Web.Studio.dll", "ASC.Web.Studio", "core:eventBus:subscriptionClientName=asc_event_bus_webstudio_queue"]
Expand Down
19 changes: 19 additions & 0 deletions install/docker/docker-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,24 @@ def writeJsonFile(jsonFile, jsonData, indent=4):
with open(filePath, 'w') as f:
f.write(configData)

plugins_dir = '/var/www/studio/plugins'
webplugins_dir = '/app/onlyoffice/data/Studio/webplugins'

if os.path.exists(plugins_dir) and not os.path.exists(webplugins_dir):
os.makedirs(webplugins_dir)

for item in os.listdir(plugins_dir):
src_item = os.path.join(plugins_dir, item)
dst_item = os.path.join(webplugins_dir, item)

if os.path.isdir(src_item):
os.makedirs(dst_item, exist_ok=True)
for sub_item in os.listdir(src_item):
with open(os.path.join(src_item, sub_item), 'rb') as fsrc, open(os.path.join(dst_item, sub_item), 'wb') as fdst:
fdst.write(fsrc.read())
else:
with open(src_item, 'rb') as fsrc, open(dst_item, 'wb') as fdst:
fdst.write(fsrc.read())

run = RunServices(SERVICE_PORT, PATH_TO_CONF)
run.RunService(RUN_FILE, ENV_EXTENSION, LOG_FILE)

0 comments on commit f9834bf

Please sign in to comment.