Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution to the issue 'No output using this example #1' #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kolman-Freecss
Copy link

Hi mate!

I checked the issue 'No output using this example #1' because I had that also, so I fixed it with the next changes and now it works correctly:

The main point and the fix is the creation of the virtual environment inside the docker and the specification of the environment variable PATH. The other modifications is only extra features, check it if you want! :)

Changes:

  • Update to Python 3.10
  • Execute crontab using only the keyword 'crontab'
  • Creation and execution of a virtual environment inside docker
  • Tail the logs to check the logs directly on the console

- Execute crontab using only the keyword 'crontab'
- Creation and execution of a virtual environment inside docker
- Tail the logs to check the logs directly on the console
@Kolman-Freecss Kolman-Freecss changed the title - Update to Python 3.10 Solution to the issue 'No output using this example #1' Feb 8, 2023
@adiii717
Copy link
Owner

adiii717 commented Feb 9, 2023

Hello,
Thanks for the PR, but I have two points that I would like to highlight

  • the virtual environment is discouraged in the docker container, the main purpose of the virtual environment is isolation while the docker-container has already come with isolation
  • We should not write logs to file and tail, it will kill the primary purpose of the container "one process per container" and it will also need extra effort to truncate the log file incase of extensive logging.

So writing logs to stdout/stderror is best choice.

Let me bump the version, and will add the comment

@adiii717
Copy link
Owner

adiii717 commented Feb 9, 2023

okay just update the image version and I can still the output

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7

Mac OS 13.1

@adiii717
Copy link
Owner

adiii717 commented Feb 9, 2023

image

@Kolman-Freecss
Copy link
Author

Your first point about the isolated system it's a good point to debate, but you could isolate both environments (System - Python)

Check these links:

About the second point I agree with you, they are best practices, but this is a quick solution (and not a bad solution in my personal opinion).

However, if I not specify the virtual environment and the PATH my application doesn't works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants