
JUSTDOIT is a container for making home-brewn JAM-stack apps without bullshit. Kubernetes-friendly.
About
This image does the following:
- (Conditionally) adds a deploy key for your repo;
- Clones the repo;
- Runs a setup command specified by you (default is
npm install); - Runs a build command specified by you (or defaults to
npm run build); - Serves a static HTTP server on port
8080; - Fetches the repo at a given interval and rebuilds your site if the repo changed.
Only a single branch is cloned, with the default number of commits of 10 (it fetches only a part of the history).
This image is based on node.js LTS image. It contains npm and yarn. Made with Podman.
Examples β¬ ππ ππͺπ¦
Getting the image
Alpine (recommended):
docker pull cosmomyzrailgorynych/justdoit:latest-alpine
Or vanilla:
docker pull cosmomyzrailgorynych/justdoit
Also see the repo at the Docker hub.
Environment variables
GIT_URL(required) β the URL to clone. For public repos, it can be anything supported bygit clone. If you are using a private repo, agit@β¦URL with a deploy key is required.GIT_DEPLOY_KEYβ a private key that has read access to the repo atGIT_URL. It must be a string that has:- its lines joined and split with literal
\n; - an additional
\nat the end of it.
- its lines joined and split with literal
GIT_DEPLOY_PASSPHRASEβ suits both as a potential passphrase and a password for git requests. Usually not needed at all; defaults to an empty string.GIT_DEPLOY_FORMATβrsa,ed25519and such. Defaults torsa. Sets the filename of a private key in the~/.sshdirectory.GIT_DEPTHβ the number of commits to fetch from the repo. Other commits will not be downloaded. Defaults to10.GIT_PULL_RATEβ the duration of a pause between builds, in minutes. Defaults to5(five minutes). Fractional periods (like1.5) can be used.GIT_BRANCHβ the branch to checkout. Other branches will not be downloaded. Defaults tomaster.
BUILD_SETUPβ a shell script that will be executed once after a repo is cloned. Multiline strings (split with literal\n) will be split into separate sequential commands. Escaped lines (\\n) will be joined into one line.BUILD_SCRIPTβ a shell script that will be executed after a repo is cloned or successfully cloned. Behaves in the same way asBUILD_SETUP.BUILD_TIMEOUTβ Maximum time to wait for a build to finish, in minutes.BUILD_AUTOWIPEβ Whether or not the folder atSERVE_DIRshould be removed before building the repo. Defaults to1(wipe); set to0to disable it.
SERVE_DIRβ a directory inside your repo to serve. Defaults to./dist.SERVE_DOTFILESβ0or1(default). Whether files with dots at the beginning of their name (like.gitignore) will be served.SERVE_404β a path to a file that will be served if a client opens an invalid URL. Defaults to404.html. If the file is not found, a plain-text response will be given.
Support
Eh.
Bugs & PRs
Send them to this repo. Making stuff for podman/docker/crio/whatever is the last thing I would usually do, so donβt await for active maintenance. You get stuff for free without any warrancies.