diff --git a/.dockerignore b/.dockerignore index 9b6cca3..836662f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ .git -.gitignore node_modules .opencode/node_modules .local.env diff --git a/Dockerfile b/Dockerfile index c2c732e..ac0f734 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,10 @@ RUN sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http:/ sed -i "s|http://archive.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g; s|http://security.ubuntu.com|https://${UBUNTU_APT_MIRROR}|g" /etc/apt/sources.list.d/*.sources 2>/dev/null || true && \ apt-get update && apt-get install -y --no-install-recommends \ curl \ + jq \ unzip \ python3 \ python3-venv && \ - jq && \ curl -LsSf https://astral.sh/uv/install.sh | sh && \ ln -s /root/.local/bin/uv /usr/local/bin/uv && \ ln -sf /usr/bin/python3 /usr/local/bin/python && \ @@ -52,7 +52,9 @@ RUN bun install --frozen-lockfile FROM base AS build WORKDIR /app -COPY tsconfig.json opencode.json README.md ./ +COPY --from=deps /app/node_modules ./node_modules +COPY --from=deps /app/.opencode/node_modules ./.opencode/node_modules +COPY tsconfig.json opencode.json README.md .gitignore ./ COPY src ./src COPY .opencode ./.opencode RUN bun run check @@ -67,7 +69,7 @@ ENV PORT=8787 COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/.opencode/node_modules ./.opencode/node_modules COPY package.json bun.lock ./ -COPY tsconfig.json opencode.json ./ +COPY tsconfig.json opencode.json .gitignore ./ COPY src ./src COPY .opencode ./.opencode @@ -75,7 +77,6 @@ COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -COPY .opencode ./.opencode EXPOSE 8787 CMD ["bun", "src/server.ts"] diff --git a/src/runtime/opencode.ts b/src/runtime/opencode.ts index 9d63df4..c6851f9 100644 --- a/src/runtime/opencode.ts +++ b/src/runtime/opencode.ts @@ -167,6 +167,7 @@ export class OpencodeRuntimeAdapter { "starting opencode server in embedded mode", ); + const startedAt = Date.now(); let runtime; try { runtime = await createOpencode({ @@ -186,6 +187,16 @@ export class OpencodeRuntimeAdapter { throw error; } + logger.info( + { + elapsedMs: Math.max(0, Date.now() - startedAt), + hostname: config.OPENCODE_HOSTNAME, + port: config.OPENCODE_PORT, + mode: config.OPENCODE_MODE, + }, + "opencode server started in embedded mode", + ); + this.closeServer = () => { runtime.server.close(); };