From 40f73ee98c743afe6aaeb1f3582dfd6a0086d379 Mon Sep 17 00:00:00 2001 From: Dmitriy Petrov Date: Sat, 11 Jul 2026 19:02:27 +0300 Subject: [PATCH] Include shared server modules in runtime images --- Dockerfile | 1 + Dockerfile.client | 1 + test/server/deploy-split.test.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index e1811a7..0beb5b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,7 @@ RUN if [ "${INSTALL_SINGBOX}" = "true" ]; then \ WORKDIR /app COPY package.json /app/package.json COPY src/server /app/src/server +COPY src/shared /app/src/shared COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh \ diff --git a/Dockerfile.client b/Dockerfile.client index e0525ec..09cebec 100644 --- a/Dockerfile.client +++ b/Dockerfile.client @@ -33,6 +33,7 @@ WORKDIR /app COPY --from=web-build /src/dist /app/dist COPY package.json /app/package.json COPY src/server /app/src/server +COPY src/shared /app/src/shared COPY entrypoint.client.sh /entrypoint.client.sh RUN chmod +x /entrypoint.client.sh \ diff --git a/test/server/deploy-split.test.js b/test/server/deploy-split.test.js index 6f48520..63ab816 100644 --- a/test/server/deploy-split.test.js +++ b/test/server/deploy-split.test.js @@ -7,6 +7,8 @@ const root = path.resolve(import.meta.dirname, '../..'); const compose = fs.readFileSync(path.join(root, 'docker-compose.gateway.yml'), 'utf8'); const deploy = fs.readFileSync(path.join(root, 'scripts/deploy-gateway.sh'), 'utf8'); const workflow = fs.readFileSync(path.join(root, '.gitea/workflows/gateway-build.yml'), 'utf8'); +const dockerfiles = ['Dockerfile', 'Dockerfile.client'] + .map((file) => fs.readFileSync(path.join(root, file), 'utf8')); test('gateway deploy updates control without recreating dataplane', () => { assert.match(compose, /vpn-proxy-control:/); @@ -15,3 +17,9 @@ test('gateway deploy updates control without recreating dataplane', () => { assert.match(deploy, /up -d --no-deps --wait[^\n]+vpn-proxy-control/); assert.match(workflow, /UPDATE_DATAPLANE="\$\{UPDATE_DATAPLANE\}"/); }); + +test('runtime images include shared server modules', () => { + for (const dockerfile of dockerfiles) { + assert.match(dockerfile, /COPY src\/shared \/app\/src\/shared/); + } +});