A Deconst component that assembles and returns completed HTML documents to end users.
To develop locally, you'll need to install:
Then, you should copy env.example
and save it as env
. Open the file in your favorite text editor, and follow the included instructions to add values to each environment variable. They're all required.
Once you've filled in all the environment variables, use source
to add them to your current Bash environment:
source ./env
And now you're ready to actually run the app! Just build the images and start the stack:
docker-compose build && docker-compose up -d
The app will run in the background until you run docker-compose stop
. You can also run docker-compose logs
to see what the app is doing.
The presenter portion of the app runs under nodemon, so the presenter will be restarted automatically every time you save a file that's part of its source code. Certain changes (like adding a dependency to package.json
) will require you to rebuild and restart the container.
These instructions will create the resources necessary to run the deconst presenter service in a dev env in Kubernetes with Minikube.
If necessary, deploy the content service
Open a new shell
Customize your environment settings
cp env.example env
${EDITOR} env
Edit the following environment variables.
DOCKER_IMAGE=kube-registry.kube-system.svc.cluster.local:31000/presenter:dev
CONTENT_SERVICE_URL=http://content.deconst.svc.cluster.local:9000/
CONTROL_REPO_PATH=/tmp/control-repo
CONTROL_REPO_URL=https://github.com/deconst/deconst-docs-control.git
PRESENTED_URL_DOMAIN=deconst.horse
source ./env
Build a development Docker image
eval $(minikube docker-env)
docker build --tag kube-registry.kube-system.svc.cluster.local:31000/presenter:dev .
docker push kube-registry.kube-system.svc.cluster.local:31000/presenter:dev
Create resources
script/template kubernetes/deployment.yaml | kubectl apply -f -
Watch and wait for resources
watch kubectl get pods --namespace deconst
Test that the presenter and staging presenter services are nominally working
curl $(minikube service --url --namespace deconst presenter)/version/
curl $(minikube service --url --namespace deconst staging-presenter)/version/
Deploy the deconst docs
Delete resources
kubectl delete deploy/presenter svc/presenter --namespace deconst
kubectl delete deploy/staging-presenter svc/staging-presenter --namespace deconst