diff --git a/README.md b/README.md index f42d0c7d6..e6637b81f 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,19 @@ docker-compose up -d docker-compose logs -f ``` +Note: The Dockerfile builds a production environment (**not** development). You will need to add production credentials to `config/database/yml`, eg: + +``` +production: + <<: *default + database: hmpps-book-secure-move-api +``` + +If `docker compose up` fails with the error: `We could not find your database: hmpps-book-secure-move-api`, setup the database: +``` +docker-compose run web bin/rails db:setup +``` + You can force rebuilding the container with: ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 5931aae94..8b679b634 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres volumes: - - './.data/postgres:/var/lib/postgresql/data' + - './.data/postgres:/var/lib/postgresql@16/data' ports: - 5432:5432 redis: @@ -20,9 +20,10 @@ services: - LOCALSTACK_SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - - './.data/localstack:/tmp/localstack' + - './localstack:/var/lib/localstack' - '/var/run/docker.sock:/var/run/docker.sock' web: + platform: linux/x86_64 build: . env_file: - ./.env