diff --git a/Dockerfile b/Dockerfile index d9ecc59b34..4bf674e526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,7 @@ -# Stage 1: Build dependencies in a temporary stage -FROM node:23.3.0 AS builder - -# Install required global dependencies -RUN apt-get update && apt-get install -y \ - python3 \ - build-essential \ - git \ - curl \ - sqlite3 && \ - apt-get clean \ - && npm install -g pnpm@9.4.0 +FROM node:23.3.0 +RUN npm install -g pnpm@9.4.0 -# Set working directory +# Set the working directory WORKDIR /app # Add configuration files and install dependencies @@ -19,65 +9,22 @@ ADD pnpm-workspace.yaml /app/pnpm-workspace.yaml ADD package.json /app/package.json ADD .npmrc /app/.npmrc ADD tsconfig.json /app/tsconfig.json -ADD pnpm-lock.yaml /app/pnpm-lock.yaml - -# Install dependencies -RUN pnpm install +ADD turbo.json /app/turbo.json -# Copy source code +# Add the documentation ADD docs /app/docs + +# Add the rest of the application code +ADD agent /app/agent ADD packages /app/packages + +# Add the environment variables ADD scripts /app/scripts ADD characters /app/characters -ADD agent /app/agent - -# Add dependencies to workspace root -RUN pnpm add -w -D ts-node typescript @types/node - -WORKDIR /app/packages/agent +ADD .env /app/.env -# Add dependencies to the agent package specifically -RUN pnpm add -D ts-node typescript @types/node --filter "@ai16z/agent" - -WORKDIR /app/packages/core -RUN pnpm add -D ts-node typescript @types/node --filter "@ai16z/eliza" - -WORKDIR /app - -# Optional: build step if using TypeScript or other build process +RUN pnpm i RUN pnpm build -# Stage 2: Production image -FROM node:23.3.0 - -# Install dependencies required for the final runtime -RUN apt-get update && apt-get install -y \ - python3 \ - build-essential \ - git \ - curl \ - sqlite3 && \ - apt-get clean \ - && npm install -g pnpm@9.4.0 - -# Set working directory -WORKDIR /app - -# Copy built files from the builder stage -COPY --from=builder /app /app - -# install playwright -RUN pnpm exec playwright install -RUN pnpm exec playwright install-deps - -# Expose application port if running a web server -EXPOSE 3000 - -# Add health check to ensure the app is running -HEALTHCHECK --interval=30s --timeout=10s --start-period=5s CMD curl -f http://localhost:3000 || exit 1 - -# Set environment variables to configure runtime model settings -ENV NODE_ENV=production - -# Default command to run the application -CMD ["pnpm", "start"] +# Command to run the container +CMD ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 4d0758d668..5218297e48 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,9 @@ services: tee: command: ["pnpm", "start"] - image: hashwarlock/tee-agent:latest + build: + context: . + dockerfile: Dockerfile stdin_open: true tty: true volumes: