You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2020. It is now read-only.
A Python Docker that downloads a Git repository with whatever project you want when a container runs for the first time.
This branch uses the default root user of the container, instead of creating a limited user at build time.
Objective
Run a Python app that is hosted on any Git repository, without having to create a specific Docker image for that project and version.
This image lets you create a container, setting during the container creation process the URL of the Git repository the project is hosted on.
Advantages
One single image lets you run any number of Python projects, without having to build one image per project. The latest/wanted version of that project is cloned during the first execution of the container trough Git. Any update on the project can be downloaded by just rebuilding the container.
How does it work?
When you create a new container and properly set the Git URL (using the GIT_REPOSITORY ENV), during the first execution, the entrypoint bash script will clone that repository to your container, install all the Python requirements through pip, and start it.
After this first startup, whenever the container is started, a hidden file will tell the entrypoint script that the container has been executed for the first time before, and won't clone the app through Git, just starting it.
How to build?
On the host system:
Clone this repository
Build a new Docker image using the repository directory
Create a new container, setting up the desired ENV variables