This repo generates my personal website and resume. It uses docker for hosting on Heroku. The site is open to public, and intended for colleagues, friends, family and recruiters.
The site uses flask framework to serve markdown blog posts according to my custom scripts.
The following are the setup instructions for installing the codebase locally to continue development. Follow each step here and ensure tests are working.
This project uses Python 3.12
Ensure you have and installation of Poetry 2.1.1 or above, along with poetry-version-plugin.
Also add the following extras:
poetry self add poetry-plugin-shell
poetry self add poetry-plugin-exportSet preference for in-project virtual environment
poetry config virtualenvs.in-project trueMake sure you deactivate any existing virtual environments (i.e. conda).
poetry installYou may need to point poetry to the correct python interpreter using the following command.
In another terminal and in conda, run which python.
poetry env use /path/to/python3Library can be built using
poetry buildNox is a python task automation tool similar to Tox, Makefiles or scripts.
The following command can be used to run mypy, lint, and tests. It is recommended to run these before pushing code, as this is run with Github Actions. Some checks such as black are run more frequently with pre-commit.
poetry run noxLocal Sphinx documentation can be generated with the following command. Documentation publishing using Github Actions to Github pages is enabled by default.
poetry run nox -s docsAll other task automations commands can be optionally run locally with below command.
poetry run nox -s black safety pytype typeguard coverage xdoctest autoflakeOn first time use of the repository, pre-commit will need to be installed locally. You can use the following command to install and run pre-commit over all files. See .pre-commit-config.yaml for checks in use. Intention is to have lightweight checks that automatically make code changes.
pre-commit run --all-filesAfter following above instructions to use poetry environment, view website locally with following command:
python run.py
...
* Serving Flask app 'personalsite' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)Visit localhost on browser.
Webserver can be started using docker-compose or Dockerfile. The Heroku publishing via github actions uses Dockerfile.
docker-compose build
docker-compose up
docker-compose downAlternatively run from Dockerfile:
docker build -t bluemania/personalsite .
docker run -p 5000:5000 -e PORT=5000 --rm bluemania/personalsite
docker stop $(docker ps -a -q)Visit localhost on browser.
The following commands are used to push the containerized webserver to Heroku. These steps currently need to be performed in local development environment.
heroku login
docker build -t bluemania/personalsite .
heroku container:login
docker tag bluemania/personalsite registry.heroku.com/nickjenkins/web
docker push registry.heroku.com/nickjenkins/web
heroku container:release web -a nickjenkins
- Nick Jenkins - Data Scientist, API & Web dev, Team lead, Writer
See CONTRIBUTING.md in Github repo for specific instructions on contributing to project.
Usage rights governed by LICENSE in Github repo or page footer.