Files
rengine/docker-compose.dev.yml
T
2c9e2503a9 Complete dev environment to debug/code easily (#1196)
* Add django debug toolbar

* Remove duplicate debug toolbar URLs

* Remove orphaned import in startScan

* Add DEBUG config commented in entrypoint

* Install debug toolbar into celery beat

* Create dev docker compose & entrypoints

* Move django toolbar install to dev entrypoints

* Install debug_toolbar only when debug env var is set

* Add dev command to MakeFile

* Use DEBUG from settings.py exclusively

* Add remote debug configuration in dev env

* Add VSCode debug configuration

* Celery log level to 1 when debug is on

* Remove hard coded celery debug port

* Add gunicorn in the production setup

* Add export var for celery log level

* Restrict debug port to 127.0.0.1

* Set remote debug to false by default

* Update doc on debug step for submitting issue

* Create dev docker compose & entrypoints

* Add django debug toolbar

* Remove duplicate debug toolbar URLs

* Remove orphaned import in startScan

* Add DEBUG config commented in entrypoint

* Install debug toolbar into celery beat

* Move django toolbar install to dev entrypoints

* Install debug_toolbar only when debug env var is set

* Add dev command to MakeFile

* Use DEBUG from settings.py exclusively

* Add remote debug configuration in dev env

* Add VSCode debug configuration

* Celery log level to 1 when debug is on

* Remove hard coded celery debug port

* Add gunicorn in the production setup

* Add export var for celery log level

* Restrict debug port to 127.0.0.1

* Set remote debug to false by default

* Update doc on debug step for submitting issue

---------

Co-authored-by: Raynald <raynald@easi-services.fr>
Co-authored-by: Psyray <psyray@users.noreply.github.com>
2024-03-18 10:33:16 +01:00

174 lines
4.5 KiB
YAML

version: '3.8'
services:
db:
restart: always
image: "postgres:12.3-alpine"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- rengine_network
ports:
- "127.0.0.1:5432:5432"
redis:
image: "redis:alpine"
hostname: redis
networks:
- rengine_network
celery:
build:
context: ./web
restart: always
entrypoint: /usr/src/app/celery-entrypoint-dev.sh
volumes:
- ./web:/usr/src/app
- github_repos:/usr/src/github
- wordlist:/usr/src/wordlist
- scan_results:/usr/src/scan_results
- gf_patterns:/root/.gf
- nuclei_templates:/root/nuclei-templates
- tool_config:/root/.config
- static_volume:/usr/src/app/staticfiles/
environment:
- DEBUG=1
- REMOTE_DEBUG=0
- REMOTE_DEBUG_PORT=5679
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
- DOMAIN_NAME=${DOMAIN_NAME}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
- MAX_CONCURRENCY=${MAX_CONCURRENCY}
- MIN_CONCURRENCY=${MIN_CONCURRENCY}
ports:
- "127.0.0.1:5679:5679"
depends_on:
- db
- redis
networks:
- rengine_network
celery-beat:
build: ./web
entrypoint: /usr/src/app/beat-entrypoint-dev.sh
command: celery -A reNgine beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
environment:
- DEBUG=1
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
depends_on:
- celery
volumes:
- ./web:/usr/src/app
- github_repos:/usr/src/github
- wordlist:/usr/src/wordlist
- scan_results:/usr/src/scan_results
- gf_patterns:/root/.gf
- nuclei_templates:/root/nuclei-templates
- tool_config:/root/.config
networks:
- rengine_network
web:
build:
context: ./web
entrypoint: /usr/src/app/entrypoint-dev.sh
restart: always
image: docker.pkg.github.com/yogeshojha/rengine/rengine:latest
environment:
- DEBUG=1
- REMOTE_DEBUG=0
- REMOTE_DEBUG_PORT=5678
- CELERY_BROKER=redis://redis:6379/0
- CELERY_BACKEND=redis://redis:6379/0
- DOMAIN_NAME=${DOMAIN_NAME}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
# THIS IS A MUST FOR CHECKING UPDATE, EVERYTIME A COMMIT IS MERGED INTO
# MASTER, UPDATE THIS!!! MAJOR.MINOR.PATCH https://semver.org/
- RENGINE_CURRENT_VERSION='2.0.3'
volumes:
- ./web:/usr/src/app
- github_repos:/usr/src/github
- wordlist:/usr/src/wordlist
- scan_results:/usr/src/scan_results
- gf_patterns:/root/.gf
- nuclei_templates:/root/nuclei-templates
- tool_config:/root/.config
- static_volume:/usr/src/app/staticfiles
ports:
- "8000:8000"
- "127.0.0.1:5678:5678"
depends_on:
- db
- celery
- celery-beat
networks:
rengine_network:
aliases:
- rengine
proxy:
restart: always
image: nginx:alpine
ports:
- 8082:8082/tcp
- 443:443/tcp
depends_on:
- web
- db
- redis
secrets:
- source: proxy.ca
target: /etc/nginx/certs/rengine_chain.pem
- source: proxy.cert
target: /etc/nginx/certs/rengine.pem
- source: proxy.key
target: /etc/nginx/certs/rengine_rsa.key
volumes:
- ./config/nginx/rengine.conf:/etc/nginx/conf.d/rengine.conf:ro
- static_volume:/usr/src/app/staticfiles
- scan_results:/usr/src/scan_results
networks:
- rengine_network
networks:
rengine_network:
volumes:
tool_config:
postgres_data:
gf_patterns:
nuclei_templates:
github_repos:
wordlist:
scan_results:
static_volume:
secrets:
proxy.ca:
file: ./secrets/certs/rengine_chain.pem
proxy.key:
file: ./secrets/certs/rengine_rsa.key
proxy.cert:
file: ./secrets/certs/rengine.pem