Skip to content

Commit

Permalink
Update docker-compose to build a local production environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyprivett committed Nov 4, 2024
1 parent 6e6182b commit bbc9a57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
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

0 comments on commit bbc9a57

Please sign in to comment.