build(docker): fix agent image build
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
.git
|
.git
|
||||||
.gitignore
|
|
||||||
node_modules
|
node_modules
|
||||||
.opencode/node_modules
|
.opencode/node_modules
|
||||||
.local.env
|
.local.env
|
||||||
|
|||||||
+5
-4
@@ -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 && \
|
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 \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
|
jq \
|
||||||
unzip \
|
unzip \
|
||||||
python3 \
|
python3 \
|
||||||
python3-venv && \
|
python3-venv && \
|
||||||
jq && \
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||||
ln -s /root/.local/bin/uv /usr/local/bin/uv && \
|
ln -s /root/.local/bin/uv /usr/local/bin/uv && \
|
||||||
ln -sf /usr/bin/python3 /usr/local/bin/python && \
|
ln -sf /usr/bin/python3 /usr/local/bin/python && \
|
||||||
@@ -52,7 +52,9 @@ RUN bun install --frozen-lockfile
|
|||||||
FROM base AS build
|
FROM base AS build
|
||||||
WORKDIR /app
|
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 src ./src
|
||||||
COPY .opencode ./.opencode
|
COPY .opencode ./.opencode
|
||||||
RUN bun run check
|
RUN bun run check
|
||||||
@@ -67,7 +69,7 @@ ENV PORT=8787
|
|||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /app/.opencode/node_modules ./.opencode/node_modules
|
COPY --from=deps /app/.opencode/node_modules ./.opencode/node_modules
|
||||||
COPY package.json bun.lock ./
|
COPY package.json bun.lock ./
|
||||||
COPY tsconfig.json opencode.json ./
|
COPY tsconfig.json opencode.json .gitignore ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY .opencode ./.opencode
|
COPY .opencode ./.opencode
|
||||||
|
|
||||||
@@ -75,7 +77,6 @@ COPY entrypoint.sh /entrypoint.sh
|
|||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
COPY .opencode ./.opencode
|
|
||||||
|
|
||||||
EXPOSE 8787
|
EXPOSE 8787
|
||||||
CMD ["bun", "src/server.ts"]
|
CMD ["bun", "src/server.ts"]
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ export class OpencodeRuntimeAdapter {
|
|||||||
"starting opencode server in embedded mode",
|
"starting opencode server in embedded mode",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const startedAt = Date.now();
|
||||||
let runtime;
|
let runtime;
|
||||||
try {
|
try {
|
||||||
runtime = await createOpencode({
|
runtime = await createOpencode({
|
||||||
@@ -186,6 +187,16 @@ export class OpencodeRuntimeAdapter {
|
|||||||
throw error;
|
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 = () => {
|
this.closeServer = () => {
|
||||||
runtime.server.close();
|
runtime.server.close();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user