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

Docker: Fixes annoying message at restart, makes the image easier to use in non root mode + Cleanup useless files #958

Merged
merged 1 commit into from
May 19, 2024

Conversation

fathzer
Copy link
Contributor

@fathzer fathzer commented May 11, 2024

Some enhancements of the Docker image:

  • Makes config.yml link during image build, not at runtime.
  • Removes useless ARG in Docker file.
  • Removes useless files in the image (everything but copy_files.sh in docker directory)

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

The main change is to make the config.yml link during the build.
The advantages are:

  • No more annoying ln: /lichess-bot/config.yml: File exists message in log when a container is restarted.
  • More importantly: for those, like me, who don't need custom extra_game_handlers.py or extra_game_handlers.py, this allows again (as in version 2024.5.1.2) to run a container based on this image as a non-root user without digging into the source code to guess what permissions are required to prevent the launch from failing with a permission error.
    Since the link is created during construction, no permissions are needed to use it at runtime.
    PS: Running a container as root on a production environment is a well-known worst practice. Copying extra_game_handlers.py or extra_game_handlers.py into the container file system still requires guessed permissions.

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Easier in non root mode:
- Makes config.yml link in image, not at runtime.
Cleanup
- Removes useless ARG in Docker file.
- Removes useless files in image
@MarkZH MarkZH merged commit d7ff497 into lichess-bot-devs:master May 19, 2024
15 checks passed
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.

3 participants