Skip to content

Commit

Permalink
merging PR Chaosthebot#499: add a docker debug environment
Browse files Browse the repository at this point in the history
Chaosthebot#499: add a docker debug environment

Description:
this way `import pdb; pdb.set_trace()` will work correctly when debugging your code

:white_check_mark: PR passed with a vote of 8 for and 0 against, a weighted total of 8.0 and a threshold of 6.5, and a current meritocracy review.

Vote record:
@Leigende: 1
@PlasmaPower: 1
@Swizz: 1
@amoffat: 1
@andrewda: 1
@e-beach: 1
@hongaar: 1
@mark-i-m: 1
  • Loading branch information
amoffat authored and chaosbot committed Jun 3, 2017
1 parent 4424517 commit 710260e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dev/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ You can simply run `docker-compose up chaos`.

Or you can run with `bash run.sh` or `run.bat`.

## Debugging

To debug your code, you probably want to drop into a debugger via `import pdb;
pdb.set_trace()`. To do this, you need to run `docker-compose run debug`, will
run the chaos container in interactive mode, and without starting under
[supervisor](http://supervisord.org/). Starting chaos this way will let you
interact with the debugger.

## Testing

Make sure you're in `dev/docker/`.
You can simply run `docker-compose up tests`.

Or you can also run tests with `bash test.sh` or `test.bat`.

## Testing

You can run tests with `bash test.sh` or `test.bat`.

## Development Cycle

The repo dir exists as a mounted [data
Expand Down
14 changes: 14 additions & 0 deletions dev/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ services:
volumes:
- ../..:/root/workspace/Chaos

debug:
image: chaos
build:
context: ../..
dockerfile: ./dev/docker/Dockerfile
command: python chaos.py
depends_on:
- db
ports:
- 8082:80
- 8081:8081
volumes:
- ../..:/root/workspace/Chaos

db:
image: mysql:5.7
volumes:
Expand Down

0 comments on commit 710260e

Please sign in to comment.