Created
October 6, 2021 11:34
-
-
Save jcopps/c907561a6b3372194b7262987ed39287 to your computer and use it in GitHub Desktop.
How to debug a docker-compose service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Doesn't work / throws an error. | |
Just go into the container and debug the same command by just making changes like this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix the error looking at console or logs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run the service again. All set |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment