The personal website of Matthew Lymer
- Docker
- Google Cloud Platform Account
docker-compose up
Then browse to http://localhost:5000.
The project is hosted on Google Cloud Platform using Cloud Run. This was chosen for the ease of deployment and relatively low cost.
Terraform is used to make infrastructure changes.
Docker is used to contain the application and for ease of dependency management in the hosting environment.
Start a terraform docker container
docker run -it -e "GOOGLE_APPLICATION_CREDENTIALS=/root/.config/gcloud/legacy_credentials/PUT-ACCOUNT-NAME-HERE/adc.json" -v ${HOME}/.config/gcloud:/root/.config/gcloud -w /data/infrastructure -v ${PWD}:/data --entrypoint /bin/sh hashicorp/terraform
Then from within the shell, you can initialize terraform and apply the changes
terraform init
terraform apply
If this is the first time you've run terraform for this project, you may receive "access denied" type errors, since adding permissions is not instantaneous (or maybe an order of operations issues, not sure).
Once terraform has configured the project properly you can now upload the docker image.
docker run -it --rm -v ${HOME}/.config/gcloud:/root/.config/gcloud -w /data -v ${PWD}:/data -v /var/run/docker.sock:/var/run/docker.sock google/cloud-sdk /bin/bash "-c" "make push-docker"