From 99a528b472304da642058af08cc126ffdeb87735 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Thu, 12 Dec 2024 17:17:38 +0545 Subject: [PATCH] build: add dockerfile and deployment docs --- Dockerfile | 13 +++++++++++++ README.md | 23 +++++++++++++++++++++-- deployments/3dviewer.yaml | 13 +++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 deployments/3dviewer.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..caf08f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM owncloudci/nodejs:20 AS stage + +WORKDIR /extension + +COPY . . +RUN pnpm install +RUN pnpm build + +FROM alpine:3.20 + +WORKDIR /app + +COPY --from=stage /extension/dist ./ \ No newline at end of file diff --git a/README.md b/README.md index 90cc85a..d462433 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,31 @@ This is an extension for [ownCloud web](https://github.com/owncloud/web) for vie ## Installation -1. Download the zip file from the [releases page](https://github.com/saw-jan/web-app-3dmodel-viewer/releases) +1. Download the zip file from the [releases page](https://github.com/saw-jan/web-app-3dmodel-viewer/releases) 2. Extract the zip file to the apps directory of the oCIS server, [which is set using the `WEB_ASSET_APPS_PATH` environment variable](https://doc.owncloud.com/ocis/next/deployment/webui/webui-customisation.html#extend-web-ui-with-apps) +### App Installation With [oCIS Deployment](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full) + +1. Copy [`deployments/3dviewer.yaml`](./deployments/3dviewer.yaml) into the [web_extensions](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full/web_extensions) + subfolder of oCIS full deployment example. +2. Add `MODEL_3D_VIEWER=:web_extensions/3dviewer.yaml` to the `## oCIS Web Extensions ##` section of the `.env` file of your installation (file is located in [deployments/examples/ocis_full](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full)) and append it to the `COMPOSE_FILE` variable. + + ```env + ## oCIS Web Extensions ## + MODEL_3D_VIEWER=:web_extensions/3dviewer.yaml + + COMPOSE_FILE=docker-compose.yml${...}${3D_VIEWER:-} + ``` + +3. Run `docker compose up` to run oCIS with the extensions + + oCIS URL: [ocis.owncloud.test](https://ocis.owncloud.test) + + See the [docs](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_full) for more information. + ## Build and Run for development -For building and running the app from the code base, follow these steps: +For building and running the app from the code base, follow these steps: 1. Install the dependencies diff --git a/deployments/3dviewer.yaml b/deployments/3dviewer.yaml new file mode 100644 index 0000000..3c1203e --- /dev/null +++ b/deployments/3dviewer.yaml @@ -0,0 +1,13 @@ +services: + ocis: + depends_on: + 3dviewer: + condition: service_completed_successfully + + 3dviewer: + image: sawjan/3dviewer:0.1.0 + volumes: + - ocis-apps:/apps + entrypoint: + - /bin/sh + command: ['-c', 'cp -R /app/* /apps']