Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 2.04 KB

File metadata and controls

60 lines (39 loc) · 2.04 KB

Docker

Run the web application locally in Docker

Why?

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

How?

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

Known issues (and their solutions)

On Windows

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).

  1. Open git bash (this will not work in PowerShell)

  2. Navigate to the docker directory

  3. Rewrite your line endings by running:

    sed -i -e 's/\r$//' web-docker-entrypoint.sh
  4. Stage your changes (they will disappear after being staged)

  5. Rebuild and run the Docker container - it should now work

On Macs

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...