Skip to content

feat: Add new Dockerfile and instructions#16

Draft
s2t2 wants to merge 2 commits intocopybara_pushfrom
feat/new-docker-setup
Draft

feat: Add new Dockerfile and instructions#16
s2t2 wants to merge 2 commits intocopybara_pushfrom
feat/new-docker-setup

Conversation

@s2t2
Copy link
Owner

@s2t2 s2t2 commented Jun 9, 2025

This commit introduces a new Docker setup (Dockerfile-2) and a corresponding entrypoint script (docker-entrypoint.sh).

Key improvements in Dockerfile-2:

  • Uses Ubuntu 22.04 as the base image.
  • Streamlined Python 3.10 and Poetry installation.
  • Installs protoc and ffmpeg system libraries.
  • Copies only necessary files for dependency installation before running poetry install.
  • Installs all extras, including dev and notebook dependencies.
  • Compiles .proto files during the image build.
  • Uses an entrypoint script to provide flexibility in running commands (jupyter, python, pytest, bash).

A new INSTRUCTIONS.md file provides detailed steps on how you can:

  • Build the Docker image using Dockerfile-2.
  • Run the Docker container for various purposes:
    • Jupyter Notebooks
    • Python scripts
    • Pytest (all tests or specific ones)
    • Bash shell access
  • Includes notes on handling .proto files, dependencies, and permissions.

This new setup aims to be less bloated and more user-friendly than the previous Dockerfile.

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

This commit introduces a new Docker setup (`Dockerfile-2`) and a corresponding entrypoint script (`docker-entrypoint.sh`).

Key improvements in `Dockerfile-2`:
- Uses Ubuntu 22.04 as the base image.
- Streamlined Python 3.10 and Poetry installation.
- Installs protoc and ffmpeg system libraries.
- Copies only necessary files for dependency installation before running `poetry install`.
- Installs all extras, including dev and notebook dependencies.
- Compiles .proto files during the image build.
- Uses an entrypoint script to provide flexibility in running commands (jupyter, python, pytest, bash).

A new `INSTRUCTIONS.md` file provides detailed steps on how you can:
- Build the Docker image using `Dockerfile-2`.
- Run the Docker container for various purposes:
    - Jupyter Notebooks
    - Python scripts
    - Pytest (all tests or specific ones)
    - Bash shell access
- Includes notes on handling .proto files, dependencies, and permissions.

This new setup aims to be less bloated and more user-friendly than the previous Dockerfile.
This commit refactors the Docker setup to eliminate the need for the `docker-entrypoint.sh` script.

Changes include:
- Modified `Dockerfile-2`:
    - Removed the `COPY` and `RUN chmod` commands for `docker-entrypoint.sh`.
    - Changed the `ENTRYPOINT` to `["poetry", "run"]`. This ensures all commands are executed within the Poetry virtual environment.
    - The default `CMD` remains to start a Jupyter notebook server.
- Deleted `docker-entrypoint.sh` as it is no longer used.
- Updated `INSTRUCTIONS.md`:
    - Revised `docker run` command examples to reflect the new `ENTRYPOINT`. Commands like `python`, `pytest`, `bash` are now directly appended to `docker run ... your-image-name <command>`.
    - Clarified that the `ENTRYPOINT` handles running commands within the Poetry environment.

This simplification makes the Docker usage more direct by leveraging Poetry's run command as the entrypoint.
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.

1 participant