Skip to content

Commit f9af3bc

Browse files
committed
upd: added initial docker image fixes
1 parent 0573124 commit f9af3bc

File tree

3 files changed

+215
-22
lines changed

3 files changed

+215
-22
lines changed

Dockerfile

+44-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
11
# Use a specific Node.js version for better reproducibility
22
FROM node:23.3.0-slim AS builder
33

4-
# Install pnpm globally and install necessary build tools
4+
# Install pnpm globally and necessary build tools
55
RUN npm install -g pnpm@9.4.0 && \
66
apt-get update && \
7-
apt-get install -y git python3 make g++ && \
7+
apt-get upgrade -y && \
8+
apt-get install -y \
9+
git \
10+
python3 \
11+
python3-pip \
12+
curl \
13+
node-gyp \
14+
ffmpeg \
15+
libtool-bin \
16+
autoconf \
17+
automake \
18+
libopus-dev \
19+
make \
20+
g++ \
21+
build-essential \
22+
libcairo2-dev \
23+
libjpeg-dev \
24+
libpango1.0-dev \
25+
libgif-dev \
26+
openssl \
27+
libssl-dev && \
828
apt-get clean && \
929
rm -rf /var/lib/apt/lists/*
1030

1131
# Set Python 3 as the default python
12-
RUN ln -s /usr/bin/python3 /usr/bin/python
32+
RUN ln -sf /usr/bin/python3 /usr/bin/python
1333

1434
# Set the working directory
1535
WORKDIR /app
1636

17-
# Copy package.json and other configuration files
37+
# Copy only the essential files for dependency installation
1838
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc turbo.json ./
1939

40+
# Install dependencies
41+
RUN pnpm install --no-frozen-lockfile
42+
2043
# Copy the rest of the application code
21-
COPY agent ./agent
22-
COPY packages ./packages
23-
COPY scripts ./scripts
24-
COPY characters ./characters
44+
COPY . .
2545

26-
# Install dependencies and build the project
27-
RUN pnpm install \
28-
&& pnpm build-docker \
29-
&& pnpm prune --prod
46+
# Build the project
47+
RUN pnpm run build && pnpm prune --prod
3048

31-
# Create a new stage for the final image
49+
# Final runtime image
3250
FROM node:23.3.0-slim
3351

34-
# Install runtime dependencies if needed
52+
# Install runtime dependencies
3553
RUN npm install -g pnpm@9.4.0 && \
3654
apt-get update && \
37-
apt-get install -y git python3 && \
55+
apt-get install -y \
56+
git \
57+
python3 \
58+
ffmpeg && \
3859
apt-get clean && \
3960
rm -rf /var/lib/apt/lists/*
4061

62+
# Set the working directory
4163
WORKDIR /app
4264

4365
# Copy built artifacts and production dependencies from the builder stage
@@ -47,9 +69,14 @@ COPY --from=builder /app/.npmrc ./
4769
COPY --from=builder /app/turbo.json ./
4870
COPY --from=builder /app/node_modules ./node_modules
4971
COPY --from=builder /app/agent ./agent
72+
COPY --from=builder /app/client ./client
73+
COPY --from=builder /app/lerna.json ./
5074
COPY --from=builder /app/packages ./packages
5175
COPY --from=builder /app/scripts ./scripts
5276
COPY --from=builder /app/characters ./characters
5377

54-
# Set the command to run the application
55-
CMD ["pnpm", "start"]
78+
# Expose necessary ports
79+
EXPOSE 3000 5173
80+
81+
# Command to start the application
82+
CMD ["sh", "-c", "pnpm start & pnpm start:client"]

docker-compose.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ services:
3232
- HELIUS_API_KEY=
3333
- SERVER_PORT=3000
3434
- WALLET_SECRET_SALT=secret_salt
35+
# Refer to: https://github.com/elizaOS/eliza/blob/develop/.env.example for all available environment variables
3536
ports:
3637
- "3000:3000"
38+
- "5173:5173"
3739
restart: always
3840

3941
volumes:

pnpm-lock.yaml

+169-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)