- Install Docker Desktop
- Clone down repository locally
- Run
docker-compose run web rake db:create
to create the test and development databases - Run
docker-compose up -d --build
inghre-rails
folder - Open Docker Desktop and expand
ghre-rails
application to view logs - go to
localhost:3001
in web browser to see site - Run
docker-compose up -d --build
again to rebuild the locally running application with the latest local code
Environment variable | Example | Notes |
---|---|---|
DB_HOSTNAME |
localhost |
Development/test environment only |
DB_PORT |
5432 |
Development/test environment only |
DB_USERNAME |
postgres |
Development/test environment only |
DB_PASSWORD |
password |
Development/test environment only |
DATABASE_URL |
postgres://user:pass@localhost:5432/db |
|
GOOGLE_TAG_MGR_ID |
GTM-1234 |
|
GOOGLE_ANALYTICS_ID |
G-1234 |
docker-compose exec web bundle exec rake
docker-compose exec web bundle exec rspec
It's best to lint just your app directories and not those belonging to the framework, e.g.
docker-compose exec web bundle exec rubocop app config db lib spec Gemfile --format clang -a
or
docker-compose exec web bundle exec scss-lint app/webpacker/styles
This service is built to deploy to GOV PaaS using Docker.
Github actions on the repo can be manually triggered to deploy any branch to any of the 3 environments - dev, staging & prod
It is sometimes useful to deploy from your local machine, here are the steps:
- Your department, agency or team has a GOV.UK PaaS account
- You have a personal account granted by your organisation manager
- You have downloaded and installed the Cloud Foundry CLI for your platform
- Build the latest version of the app in Docker
- Push the image to the github dfe-digital docker registry:
ghcr.io/dfe-digital/get-help-with-remote-education-${dev/staging/prod}:latest
- Login to cloudfoundary
- Run the following
cf target -o dfe-teacher-services -s get-help-with-remote-education-dev
cf push -f ./config/manifests/${dev/staging/prod}_manifest.yml --docker-image ghcr.io/dfe-digital/get-help-with-remote-education-${dev/staging/prod}:latest