-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerized application for local development, testing and deployment #293
Merged
+112
−1
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 pnpm@9.4.0 | ||
|
||
# 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs needed in the docker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, would be great if Elizas can read their own docs.