This is a fork of the original Husky Musher redirecting service for the UW Husky Coronavirus Testing study. This fork only adapts the survey redirect modules, but also productionizes the application for deployment.
- Follow the first-time use instructions
As long as you have a docker client, you can run an existing build.
- View the package in Github
- Find the tag you are interested in running (usually the newest tag is your best option) and copy it to your clipboard
- In your terminal, run
docker pull ghcr.io/uwit-iam/husky-musher:<tag>
- Then, run
docker run -it -p 8000:8000 ghcr.io/uwit-iam/husky-musher:<tag>
- Replace
<tag>
with the tag you copied to your clipboard. - Add
--env-file local.env
before theghcr
argument if you followed the environment variables instructions and have all the necessary variables handy.
- Replace
Recommended; this will typically build faster because it is dependency-aware and uses some common optimization practices shared between UW-IT IAM projects.
./scripts/build-images.sh --run
This will automatically look for a local.env
file if you don't provide an
--env-file
argument; if local.env
is not found, the application will boot
but may not actually do much.
docker build . -t husky-musher:local
docker run \
# Omit the --env-file argument if you have not generated an env-file to use
--env-file local.dotenv \
# Omit the `--mount` argument if you do not want to sync
# the running container with your local changes
--mount type=bind,source=$(pwd)/husky_musher,target=/musher/husky_musher"
-p 8000:8000 \
-it husky-musher:local
If you are actively developing, you may be interested in running this directly from source without docker, for debugging purposes.
No problem!
If this is your first time running locally, follow first-time use.
Then:
set -a # Export all vars sourced in the next line
source local.env
set +a # Stop var exporting to avoid side effects in any future commands
poetry run flask run
If you are running a unix- or linux-like termina,
and have both poetry
and pyenv
, you can paste the
following into your terminal to configure your environment:
pyenv install 3.8.6
poetry env use ~/.pyenv/versions/3.8.6/bin/python
poetry install
You should also think about creating an env file to export environment variables; see environment variables.
Otherwise . . .
First, get poetry. Poetry makes it easy to manage application versions and dependency versions consistently and safely.
Set up your local environment to use python version 3.7+. If you don't know how to manage python versions, see managing python versions.
poetry env use /path/to/python
poetry install
You should also think about creating an env file to export environment variables; see environment variables.
pyenv is great for this, as long as you are not using Windows. If you are using Windows, please see the notes in the pyenv installation docs.
pyenv install 3.8.6
# Test the install:
~/.pyenv/versions/3.8.6/bin/python --version
Environment variable documentation can be found in docs/configuration.md.
For maintainers, see the docs/ directory!
"Paw Print" icon By Humantech from the Noun Project.