forked from ai16z/eliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerized application for local development, testing and deployment
- Loading branch information
1 parent
7fcf54e
commit ad6f439
Showing
6 changed files
with
112 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
/out | ||
|
||
.env | ||
.env.production | ||
concatenated-output.ts | ||
embedding-cache.json | ||
|
||
|
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,30 @@ | ||
FROM node:23.1.0 | ||
# Install pnpm globally | ||
RUN npm install -g [email protected] | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Add configuration files and install dependencies | ||
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 | ||
RUN pnpm i | ||
|
||
# Add the documentation | ||
ADD docs /app/docs | ||
RUN pnpm i | ||
|
||
# Add the rest of the application code | ||
ADD packages /app/packages | ||
RUN pnpm i | ||
|
||
# Add the environment variables | ||
ADD scripts /app/scripts | ||
ADD characters /app/characters | ||
ADD .env /app/.env | ||
|
||
# Command to run the container | ||
CMD ["tail", "-f", "/dev/null"] |
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
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
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
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,66 @@ | ||
#!/bin/bash | ||
|
||
# Check if an argument is provided | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 {build|run|start|bash}" | ||
exit 1 | ||
fi | ||
|
||
# Execute the corresponding command based on the argument | ||
case "$1" in | ||
build) | ||
docker build --platform linux/amd64 -t eliza . | ||
;; | ||
run) | ||
# Ensure the container is not already running | ||
if [ "$(docker ps -q -f name=eliza)" ]; then | ||
echo "Container 'eliza' is already running. Stopping it first." | ||
docker stop eliza | ||
docker rm eliza | ||
fi | ||
|
||
docker run \ | ||
--platform linux/amd64 \ | ||
-p 3000:3000 \ | ||
-d \ | ||
-v "$(pwd)/characters:/app/characters" \ | ||
-v "$(pwd)/.env:/app/.env" \ | ||
-v "$(pwd)/docs:/app/docs" \ | ||
-v "$(pwd)/scripts:/app/scripts" \ | ||
-v "$(pwd)/packages/adapter-postgres/src:/app/packages/adapter-postgres/src" \ | ||
-v "$(pwd)/packages/adapter-sqlite/src:/app/packages/adapter-sqlite/src" \ | ||
-v "$(pwd)/packages/adapter-sqljs/src:/app/packages/adapter-sqljs/src" \ | ||
-v "$(pwd)/packages/adapter-supabase/src:/app/packages/adapter-supabase/src" \ | ||
-v "$(pwd)/packages/agent/src:/app/packages/agent/src" \ | ||
-v "$(pwd)/packages/client-auto/src:/app/packages/client-auto/src" \ | ||
-v "$(pwd)/packages/client-direct/src:/app/packages/client-direct/src" \ | ||
-v "$(pwd)/packages/client-discord/src:/app/packages/client-discord/src" \ | ||
-v "$(pwd)/packages/client-telegram/src:/app/packages/client-telegram/src" \ | ||
-v "$(pwd)/packages/client-twitter/src:/app/packages/client-twitter/src" \ | ||
-v "$(pwd)/packages/core/src:/app/packages/core/src" \ | ||
-v "$(pwd)/packages/core/types:/app/packages/core/types" \ | ||
-v "$(pwd)/packages/plugin-bootstrap/src:/app/packages/plugin-bootstrap/src" \ | ||
-v "$(pwd)/packages/plugin-image-generation/src:/app/packages/plugin-image-generation/src" \ | ||
-v "$(pwd)/packages/plugin-node/src:/app/packages/plugin-node/src" \ | ||
-v "$(pwd)/packages/plugin-solana/src:/app/packages/plugin-solana/src" \ | ||
--name eliza \ | ||
eliza | ||
;; | ||
start) | ||
docker start eliza | ||
;; | ||
bash) | ||
# Check if the container is running before executing bash | ||
if [ "$(docker ps -q -f name=eliza)" ]; then | ||
docker exec -it eliza bash | ||
else | ||
echo "Container 'eliza' is not running. Please start it first." | ||
exit 1 | ||
fi | ||
;; | ||
*) | ||
echo "Invalid option: $1" | ||
echo "Usage: $0 {build|run|start|bash}" | ||
exit 1 | ||
;; | ||
esac |