forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request elizaOS#36 from JoseRoberts87/35-update-dependencies
35 update dependencies
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Use a specific Node.js version for better reproducibility | ||
FROM node:23.3.0-slim AS builder | ||
|
||
# Install pnpm globally and install necessary build tools | ||
RUN npm install -g [email protected] | ||
RUN apt-get update && \ | ||
apt-get install -y git python3 make g++ && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set Python 3 as the default python | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and other configuration files | ||
COPY package.json ./ | ||
COPY pnpm-lock.yaml ./ | ||
COPY tsconfig.json ./ | ||
|
||
# Copy the rest of the application code | ||
COPY ./src ./src | ||
COPY ./characters ./characters | ||
COPY ./.env ./ | ||
|
||
# Install dependencies and build the project | ||
RUN pnpm i | ||
RUN pnpm build | ||
# Create a new stage for the final image | ||
FROM node:23.3.0-slim | ||
|
||
# Install runtime dependencies if needed | ||
RUN npm install -g [email protected] | ||
RUN apt-get update && \ | ||
apt-get install -y git python3 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
# Copy built artifacts and production dependencies from the builder stage | ||
COPY --from=builder /app/package.json /app/ | ||
COPY --from=builder /app/node_modules /app/node_modules | ||
COPY --from=builder /app/src /app/src | ||
COPY --from=builder /app/characters /app/characters | ||
COPY --from=builder /app/.env /app/ | ||
COPY --from=builder /app/dist /app/dist | ||
COPY --from=builder /app/tsconfig.json /app/ | ||
COPY --from=builder /app/pnpm-lock.yaml /app/ | ||
|
||
EXPOSE 3000 | ||
# Set the command to run the application | ||
CMD ["pnpm", "start", "--non-interactive"] | ||
# CMD ["node", "dist/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Navigate to the script's directory | ||
cd "$(dirname "$0")"/.. | ||
echo "Cleanup started." | ||
# Find and remove node_modules directories, dist directories. | ||
find . -type d -name "node_modules" -exec rm -rf {} + \ | ||
-o -type d -name "dist" -exec rm -rf {} + | ||
|
||
echo "Cleanup completed." |