-
Notifications
You must be signed in to change notification settings - Fork 500
add docker-compose dev stack, Dockerfile, scripts #2732
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
base: master
Are you sure you want to change the base?
add docker-compose dev stack, Dockerfile, scripts #2732
Conversation
Summary of ChangesHello @kevinmuoz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to significantly simplify the local development experience for CAPE by introducing a Docker-based setup. It provides a self-contained environment using Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request is a great initiative to add Docker support for easier local development. The use of Docker Compose to orchestrate the different services (Postgres, MongoDB, and the CAPE server) is well-structured. However, there are several significant areas for improvement, primarily around Docker best practices, consistency with the existing project setup (Poetry vs. venv), and the development workflow. The current implementation clones the application from a GitHub repository during the image build, which hinders local development. My review includes suggestions to switch to copying local code, use Poetry for dependency management, optimize the Docker image, and improve the robustness of the runtime script. Addressing these points will make the Docker setup more efficient, maintainable, and developer-friendly.
| python cuckoo.py & | ||
|
|
||
| cd web | ||
|
|
||
| : "${WEB_PORT:=8000}" | ||
|
|
||
| python manage.py migrate | ||
| python manage.py runserver 0.0.0.0:${WEB_PORT} No newline at end of file |
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.
This script runs cuckoo.py as a background process and then starts the Django development server in the foreground. If the cuckoo.py process fails for any reason, the container will continue running with only the web server. For a more robust setup, consider using a process manager like supervisord to manage both processes. This would ensure that if one process dies, the entire container can be configured to restart, making the service more reliable.
Hey,
I noticed there was an old PR about Docker support from about a year ago that never got merged, so I decided to give it another try.
The goal here is just to make it easier to run CAPE locally with Docker on a small dev-only stack that works out of the box.
I’ve been testing it for a few days on Ubuntu and it runs nicely.
It uses simple environment variables and mounts a custom/conf volume so configs can be easily tweaked without rebuilding the image.
Nothing fancy for now, just something to help contributors spin up the environment quickly.
If the community finds it useful, I’d be happy to improve it later with things like Docker profiles, Nginx + uWSGI for a production-style setup, etc.
Open to any feedback or changes needed to get this merged
Thanks!