Skip to content
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

Added Docker Support #203

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Conversation

ManindraDeMel
Copy link
Contributor

@ManindraDeMel ManindraDeMel commented Oct 21, 2023

Docker Integration for the Project #125

Changes Made

  • Dockerfile Creation: Introduced a Dockerfile to containerize the project. This makes it easier for contributors and users to set up the project without worrying about dependencies.

  • Flask App Updates: Updated the Flask app to bind to 0.0.0.0 allowing it to be accessed outside of the container. Additionally, modified the port configuration using argparse for flexibility.

Building the Docker Container

Before running the application, you'll need to build the Docker container. To do this, navigate to the directory containing the Dockerfile and run:

docker build -t chatdev:latest .

This command will build a Docker image using the provided Dockerfile and tag it as chatdev:latest.

How to Run the Docker Container

To run the containerized application, use the following command:

docker run -it --rm -p 8000:8000 -e OPENAI_API_KEY=your_openai_api_key chatdev:latest

Replace your_openai_api_key with your actual OpenAI API key.

Once you have it running you can run the project as if it were your local system

Copying Files out of Docker

If you wish to copy files out of the Docker container and into the host machine, you can use the docker cp command. This can be handy, especially when chatdev finishes and you wish to upload the generated files into the webapp to be reviewed.

docker cp container_id:/path/in/container /path/on/host

Docker Image Pull Command

To pull the current Docker image (under my personal account), use:

docker pull manindrademel/chatdev:latest

Suggestion for Project Maintainers

It would be beneficial to set up a Docker account specific to this project. This way, the Docker image can reside under a more general name rather than an individual's account. I would be happy to assist in pushing the image to such an account once it's set up.

Additional Notes

The webserver in online_log/app.py will still be accessible on your local machine as we have exposed the http port on docker for this purpose.


Thank you for considering this integration. Looking forward to feedback!

Copy link

@superseppl superseppl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works!

@thinkwee
Copy link
Collaborator

Thank you for your contribution! I will make some modifications so that in the docker ChatDev can run GUI software.

@thinkwee thinkwee merged commit bd23e9b into OpenBMB:main Oct 26, 2023
@ManindraDeMel ManindraDeMel deleted the docker-integration branch October 26, 2023 06:20
@gerardsyd
Copy link

can this be run in a headless environment or does it need a display and therefore cannot be run headless?

@ManindraDeMel
Copy link
Contributor Author

ManindraDeMel commented Nov 14, 2023

can this be run in a headless environment or does it need a display and therefore cannot be run headless?

Yes it can be run headless if you are just running the CLI. See the wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants