Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP-1621 Update docker-compose to build a local production environment #2388

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading