Python is my “go to” language for most projects.
I have made some notes detailing some common code changes required when migrating from Python 2 to Python 3.
I have a number of GitHub projects which have been developed using Jupyter Notebook and deployed using regular Python.
Examining my Docker files and Docker Compose files provides a useful reference as to how this can be achieved.
My wca-db project uses Docker Compose for Jupyter Notebook and MariaDB.
The Docker Compose files are within the docker directory of the project on GitHub.
Base Images:
A number of my projects are developed in the Jupyter Base Notebook but deployed as Python.
The Dockerfile in the project root uses a multi-stage build to convert the .ipynb files to regular .py files and create a lightweight Python image for deployment.
GitHub repositories:
The base image for deployment is on DockerHub:
The hardest bit of the python-bs4 build relates to lxml but it is fully documented on GitHub.
BeautifulSoup and lxml can quickly be tested using the following Python script:
from bs4 import BeautifulSoup
soup = BeautifulSoup("<html/>", "lxml")
It should be noted that there can be problems with Python images built from Alpine Linux.
Some useful articles are listed below: