How to dockerize your own app which has external reference as github module? wow
What do we have
- Flask appication
- External lib which is used as a reference
Idea
Add reference repo as a github submodule (for easier work during local development).
Clone repo with submodules recursively:
git submodule update --init --recursive
As submodules are not included itself into main repository, but only the link, we have to handle this case in github actions worklow manually.
I prefer that way:
- Remove submodules link
- Clone repo passing Personal Access token (in case your repo is private)
Makefile
clean:
echo "[SCREENPROOF-APP/MAKE] clean"
sudo rm -r lib || true
sudo rm -r venv || true
python3.8 -m venv venv
clone-libs:
echo "[SCREENPROOF-APP/MAKE] clone-libs"
git clone https://<YOUR_PAT>:@github.com/<REPO>.git lib/<COPY_TO_PATH>
- In Dockerfile, install and link it:
install-libs:
echo "[SCREENPROOF-MODULE/MAKE] install-libs"
pip install -e <COPY_TO_PATH>
Table of Contents
Related
Posts
Installing Russian Trusted CA Certificates in Docker Containers
Fix cURL error 60 when Docker containers call Russian bank APIs, install the Russian Trusted CA and refresh the container trust store.
How to Run SSH Commands on Your Server with GitHub Actions
A practical guide to automating server management and deployments by running SSH commands from GitHub Actions workflows
Fast GAC Deployment and App Pool Recycle for SharePoint Development
A practical guide for SharePoint developers to quickly deploy DLLs to the GAC and recycle IIS app pools using Visual Studio, PowerShell scripts, and VsCommandBuddy.
Open for contract collaboration
I am available for contract-based collaboration. If you have an interesting project idea, schedule a call via Calendly.
Schedule a 30-min call