Skip to content

Instantly share code, notes, and snippets.

@jcopps
Created October 6, 2021 11:34
Show Gist options
  • Save jcopps/c907561a6b3372194b7262987ed39287 to your computer and use it in GitHub Desktop.
Save jcopps/c907561a6b3372194b7262987ed39287 to your computer and use it in GitHub Desktop.
How to debug a docker-compose service
version: '3.1'
services:
service_a:
image: "fat_image"
ports:
- "6382:6382"
volumes:
- /home/dir1:/home/dirA
- /home/dir2:/home/dirB
- /home/dir3:/home/dirC
- /home/dir4:/home/dirD
data
working_dir: /home/dirA/
environment:
- PYTHONHASHSEED=0
command: ./the_most_complex_process.py
version: '3.1'
services:
service_a:
image: "fat_image"
ports:
- "6382:6382"
volumes:
- /home/dir1:/home/dirA
- /home/dir2:/home/dirB
- /home/dir3:/home/dirC
- /home/dir4:/home/dirD
data
working_dir: /home/dirA/
environment:
- PYTHONHASHSEED=0
command: tail -F anything # ./the_most_complex_process.py
Doesn't work / throws an error.
Just go into the container and debug the same command by just making changes like this.
Fix the error looking at console or logs.
Run the service again. All set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment