Skip to content

Commit

Permalink
Merge pull request #530 from elixir-luxembourg/update_documentation
Browse files Browse the repository at this point in the history
Update backup.md
  • Loading branch information
moustaphacheikh authored Oct 16, 2024
2 parents 441213b + 71ebe52 commit 835bea7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions doc/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,42 @@ docker cp ../daisy_prod.tar.gz $(docker compose ps -q backup):/code/daisy_prod.t
# Execute the legacy_restore.sh script inside the running container
docker compose exec backup /bin/sh -c "sh /code/scripts/legacy_restore.sh /code/daisy_prod.tar.gz && rm /code/daisy_prod.tar.gz"
docker compose run web python manage.py rebuild_index --noinput
# you may also need to run migrate if you have new migration after this backup was created
docker compose exec web python manage.py migrate
docker compose exec web python manage.py collectstatic
```

Replace `../daisy_prod.tar.gz` with the actual path to legacy backup file.

### Updating Django Settings to support Docker Compose

After the restore script. you need to change settings_local.py to work with Docker Compose, follow these key changes:

1. **Database Settings:**
- Change `HOST` from `'localhost'` to the service name defined in Docker (`'db'`):
```python
'HOST': 'db',
```

2. **Haystack Solr Configuration:**
- Change Solr URL and Admin URL to use the Docker service name (`'solr'`):
```python
'URL': 'http://solr:8983/solr/daisy',
'ADMIN_URL': 'http://solr:8983/solr/admin/cores',
```

3. **Static Files:**
- Update `STATIC_ROOT` to a directory accessible by Docker containers:
```python
STATIC_ROOT = "/static/"
```

4. **Allowed Hosts:**
- Ensure you update the `ALLOWED_HOSTS` to include the IP addresses or domains used by your Docker environment:
```python
ALLOWED_HOSTS = ['IP addresses', 'daisy domain here']
```

By making these adjustments, daisy should now work seamlessly with Docker Compose.

0 comments on commit 835bea7

Please sign in to comment.