From cda5d2d14b71ba1ea681496894f1c9ee0312c9da Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 24 Sep 2021 12:49:12 -0700 Subject: [PATCH] Install Node, but take Theia from a different docker image. --- Dockerfile | 15 +-------------- Dockerfile-GitLab | 15 +-------------- entrypoint.sh | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5342d302..c01de21a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ FROM hibou/hibou-odoo:14.0 USER 0 -WORKDIR /opt/theia -COPY dev.package.json ./package.json +COPY --from=registry.gitlab.com/hibou-io/theia-python /opt/theia /opt/theia RUN set -x; \ curl -sL https://deb.nodesource.com/setup_12.x | bash - \ && apt-get install -y \ @@ -11,18 +10,6 @@ RUN set -x; \ libsecret-1-0 \ procps \ && npm install --global yarn -RUN yarn --pure-lockfile && \ - NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \ - yarn theia download:plugins && \ - yarn --production && \ - yarn autoclean --init && \ - echo *.ts >> .yarnclean && \ - echo *.ts.map >> .yarnclean && \ - echo *.spec.* >> .yarnclean && \ - yarn autoclean --force && \ - yarn cache clean && \ - chown -R 104:33 /opt/theia \ - ; USER 104 COPY --from=hibou/flow /flow /flow diff --git a/Dockerfile-GitLab b/Dockerfile-GitLab index 8200d574..0ddb71f5 100644 --- a/Dockerfile-GitLab +++ b/Dockerfile-GitLab @@ -1,8 +1,7 @@ FROM registry.gitlab.com/hibou-io/hibou-odoo/odoo:RELEASE USER 0 -WORKDIR /opt/theia -COPY dev.package.json ./package.json +COPY --from=registry.gitlab.com/hibou-io/theia-python /opt/theia /opt/theia RUN set -x; \ curl -sL https://deb.nodesource.com/setup_12.x | bash - \ && apt-get install -y \ @@ -11,18 +10,6 @@ RUN set -x; \ libsecret-1-0 \ procps \ && npm install --global yarn -RUN yarn --pure-lockfile && \ - NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \ - yarn theia download:plugins && \ - yarn --production && \ - yarn autoclean --init && \ - echo *.ts >> .yarnclean && \ - echo *.ts.map >> .yarnclean && \ - echo *.spec.* >> .yarnclean && \ - yarn autoclean --force && \ - yarn cache clean && \ - chown -R 104:33 /opt/theia \ - ; USER 104 COPY --from=registry.gitlab.com/hibou-io/hibou-odoo/flow /flow /flow diff --git a/entrypoint.sh b/entrypoint.sh index bd1016c3..2d73a291 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,14 +12,24 @@ set -e # Note that with Odoo running in the foreground, killing Odoo will kill the container. # DEV_MODE= # Unset to not use Theia at all. +# +# DEV_MODE_PATH=/opt/odoo/addons +# To change the path to start Theia in, useful to get git working. + +if [ "$DEV_MODE_PATH" == "" ] +then + export DEV_MODE_PATH=/opt/odoo +fi # setup development IDE if [ "$DEV_MODE" == "exclusive" ] then - exec node /opt/theia/src-gen/backend/main.js /opt/odoo --hostname=0.0.0.0 + cd /opt/theia + exec node /opt/theia/src-gen/backend/main.js $DEV_MODE_PATH --hostname=0.0.0.0 elif [ "$DEV_MODE" != "" ] then - node /opt/theia/src-gen/backend/main.js /opt/odoo --hostname=0.0.0.0 & + cd /opt/theia + node /opt/theia/src-gen/backend/main.js $DEV_MODE_PATH --hostname=0.0.0.0 & fi