1
- # Stage 1: Build dependencies in a temporary stage
2
- FROM node:23.3.0 AS builder
3
-
4
- # Install required global dependencies
5
- RUN apt-get update && apt-get install -y \
6
- python3 \
7
- build-essential \
8
- git \
9
- curl \
10
- sqlite3 && \
11
- apt-get clean \
12
- && npm install -g pnpm@9.4.0
1
+ FROM node:23.3.0
2
+ RUN npm install -g pnpm@9.4.0
13
3
14
- # Set working directory
4
+ # Set the working directory
15
5
WORKDIR /app
16
6
17
7
# Add configuration files and install dependencies
18
8
ADD pnpm-workspace.yaml /app/pnpm-workspace.yaml
19
9
ADD package.json /app/package.json
20
10
ADD .npmrc /app/.npmrc
21
11
ADD tsconfig.json /app/tsconfig.json
22
- ADD pnpm-lock.yaml /app/pnpm-lock.yaml
23
-
24
- # Install dependencies
25
- RUN pnpm install
12
+ ADD turbo.json /app/turbo.json
26
13
27
- # Copy source code
14
+ # Add the documentation
28
15
ADD docs /app/docs
16
+
17
+ # Add the rest of the application code
18
+ ADD agent /app/agent
29
19
ADD packages /app/packages
20
+
21
+ # Add the environment variables
30
22
ADD scripts /app/scripts
31
23
ADD characters /app/characters
32
- ADD agent /app/agent
33
-
34
- # Add dependencies to workspace root
35
- RUN pnpm add -w -D ts-node typescript @types/node
36
-
37
- WORKDIR /app/packages/agent
24
+ ADD .env /app/.env
38
25
39
- # Add dependencies to the agent package specifically
40
- RUN pnpm add -D ts-node typescript @types/node --filter "@ai16z/agent"
41
-
42
- WORKDIR /app/packages/core
43
- RUN pnpm add -D ts-node typescript @types/node --filter "@ai16z/eliza"
44
-
45
- WORKDIR /app
46
-
47
- # Optional: build step if using TypeScript or other build process
26
+ RUN pnpm i
48
27
RUN pnpm build
49
28
50
- # Stage 2: Production image
51
- FROM node:23.3.0
52
-
53
- # Install dependencies required for the final runtime
54
- RUN apt-get update && apt-get install -y \
55
- python3 \
56
- build-essential \
57
- git \
58
- curl \
59
- sqlite3 && \
60
- apt-get clean \
61
- && npm install -g pnpm@9.4.0
62
-
63
- # Set working directory
64
- WORKDIR /app
65
-
66
- # Copy built files from the builder stage
67
- COPY --from=builder /app /app
68
-
69
- # install playwright
70
- RUN pnpm exec playwright install
71
- RUN pnpm exec playwright install-deps
72
-
73
- # Expose application port if running a web server
74
- EXPOSE 3000
75
-
76
- # Add health check to ensure the app is running
77
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s CMD curl -f http://localhost:3000 || exit 1
78
-
79
- # Set environment variables to configure runtime model settings
80
- ENV NODE_ENV=production
81
-
82
- # Default command to run the application
83
- CMD ["pnpm" , "start" ]
29
+ # Command to run the container
30
+ CMD ["tail" , "-f" , "/dev/null" ]
0 commit comments