Containerized python development environment (or poor man's codespaces ;)). The default configuration is intended to be used as a datascience focused environment and has the following components:
-
Based on the official Python 3.9.14 slim bullseye image.
-
Python runs on a virtual environment created with the venv utility.
-
NumPy v. 1.23.3, pandas v. 1.5.1 and matplotlib v. 3.6.0 python modules are preinstalled by default.
-
Jupyterlab v. 3.4.8 is preinstalled and run by the entrypoint.sh script.
-
code-server to allow running [VS Code] on your browser from any machine
On a machine with docker (tested with docker desktop), clone the portable python git repository:
git clone https://github.com/vsanavia/portable-python.git
Enter the portable-python directory:
cd portable-python
Docker build your development environment:
docker build -t vsanavia/portable-python .
Run your containerized development environment on the background (detached mode) exposing ports 9090 (VS code web) and 8787 (Jupyter notebook)
docker run -d -p 9090:9090 -p 8787:8787 --name popy-container vsanavia/portable-python
VS Code will be available at http://localhost:9090 (without encryption as the self signed SSL certificate creates issues with extensions installations) and Jupyter notebook at https://localhost:8787 with a self signed SSL certificate.
To access VS Code from a remote machine, you can point your browser (tested from Chrome, Firefox and Safari on Mac) to http://localhost:9090.
To access Jupyter Lab from a remote machine, you can point your browser (tested from Chrome, Firefox and Safari on Mac) to https://localhost:8787/notebook/lab. You will receive a warning about an untrusted certificate on the first visit.
Choose the available kernel on the virtual environment (.venv) (shown on the VS Code web interface and start coding.