Last active
June 27, 2021 13:22
-
-
Save mklasen/0a21dd38549826981a30d965e449d8c6 to your computer and use it in GitHub Desktop.
Automatically reloading a python script upon file changes with nodemon
This file contains hidden or 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
import os | |
from inc.test1 import var1 | |
from inc.test2 import var2 | |
print("test1") | |
print(var1) | |
print(var2) |
This file contains hidden or 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" | |
services: | |
python: | |
container_name: python-restart-test | |
build: | |
context: . | |
command: nodemon app.py | |
working_dir: /app | |
volumes: | |
- ./:/app/ |
This file contains hidden or 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
FROM nikolaik/python-nodejs:latest | |
RUN npm install -g nodemon |
This file contains hidden or 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
# Full path: inc/test1.py | |
var2 = 'testvar2' |
This file contains hidden or 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
# Full path: inc/test2.py | |
var1 = 'testvar1' |
This file contains hidden or 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
#placeholder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment