Skip to content

europanite/standard_python_environment

CI Python Lint Pytest pages-build-deployment CodeQL Advanced

A standard Python environment built with Docker Compose.

"console"

"jupyterlab"


Features

  • Reproducibility: Dependencies are locked inside the container
  • Simplicity: Run with just docker compose commands
  • Portability: Works on Linux, macOS, and Windows
  • pip ready: Install and manage Python packages easily
  • JupyterLab support: (Optional) Run notebooks inside the container
  • X11 forwarding: (Optional) Run GUI-based Python apps

Prerequisites


Getting Started

Linux

# Clone this repository
git clone https://github.com/europanite/standard_python_environment.git
cd standard_python_environment

# Export host UID/GID
export HOST_UID=$(id -u) 
export HOST_GID=$(id -g)

# Build and run
docker compose build
docker compose up -d
docker compose exec service bash

Windows

# Clone this repository
git clone https://github.com/europanite/standard_python_environment.git
cd standard_python_environment

# Build and run
docker compose build
docker compose up -d
docker compose exec service bash

Now you are inside the Python container 🎉

If you use JupyterLab, just you need to access http://localhost:8888


Test

docker compose \
-f docker-compose.test.yml run \
--rm --entrypoint \
/bin/sh service_test -lc ' \
pytest'

License

  • Apache License 2.0