As Find information about academies and trusts is deployed in a Docker container built from /docker/Dockerfile
, running the application from Docker gives you the most live-like experience you can get on your local machine.
This can be particularly useful when:
- Making sure styling changes are up to date and work on a clean environment
- Writing automated UI tests against a branch that's not deployed
First:
- ensure the Docker engine is running
- navigate to the
docker
directory - copy the
.env.example
file, save as.env
and populate the application secrets within
To start the application and have it automatically update after any changes to the source files:
# Make sure you are in the docker directory
docker compose watch
If your container doesn't start or you see an error like this /bin/bash^M: bad interpreter: No such file or directory
it may be caused by line ending differences in the bash shell script (which we've been unable to fix in the remote repository).
-
Open git bash (this will not work in PowerShell)
-
Navigate to the docker directory
-
Rewrite your line endings by running:
sed -i -e 's/\r$//' web-docker-entrypoint.sh
-
Stage your changes (they will disappear after being staged)
-
Rebuild and run the Docker container - it should now work
If you are running on Apple M1 chip the Test Containers SQL Server image (used by the FIAT db unit tests) may not work. This can be fixed by:
- Docker Settings > General: [X] Use virtualization framework and
- Docker Settings > Features in Development: [X] Use Rosetta...