feat: initial SleepGuard implementation
Wake-on-demand proxy + agent system with SvelteKit dashboard. Monorepo: shared types, proxy (Hono + http-proxy), agent (monitors + locks), web (SvelteKit SPA). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
42
packages/agent/Dockerfile
Normal file
42
packages/agent/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
FROM node:22-slim AS base
|
||||
RUN corepack enable
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# --- Dependencies ---
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
COPY packages/shared/package.json packages/shared/
|
||||
COPY packages/agent/package.json packages/agent/
|
||||
RUN yarn install --immutable
|
||||
|
||||
# --- Build shared ---
|
||||
FROM deps AS build-shared
|
||||
WORKDIR /app
|
||||
COPY packages/shared packages/shared
|
||||
RUN yarn workspace @sleepguard/shared build
|
||||
|
||||
# --- Build agent ---
|
||||
FROM build-shared AS build-agent
|
||||
WORKDIR /app
|
||||
COPY packages/agent/tsconfig.json packages/agent/
|
||||
COPY packages/agent/src packages/agent/src
|
||||
RUN yarn workspace @sleepguard/agent build
|
||||
|
||||
# --- Production ---
|
||||
FROM base AS production
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
COPY packages/shared/package.json packages/shared/
|
||||
COPY packages/agent/package.json packages/agent/
|
||||
RUN yarn workspaces focus @sleepguard/agent --production
|
||||
|
||||
COPY --from=build-shared /app/packages/shared/dist packages/shared/dist
|
||||
COPY --from=build-agent /app/packages/agent/dist packages/agent/dist
|
||||
|
||||
WORKDIR /app/packages/agent
|
||||
EXPOSE 48527
|
||||
CMD ["node", "dist/index.js"]
|
||||
Reference in New Issue
Block a user