Skip to content

Commit 8923960

Browse files
author
Rub21
committed
Update backup database readme
1 parent dbed532 commit 8923960

File tree

1 file changed

+17
-36
lines changed

1 file changed

+17
-36
lines changed

images/backup-restore/README.md

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,26 @@ This container will create a backup of the osm-seed-db and compress according to
55

66
### Configuration
77

8-
To run the container needs a bunch of ENV variables:
8+
In order to run this container we need environment variables, these can be found in the following files👇:
99

10-
- `POSTGRES_HOST` - Database host
11-
- `POSTGRES_DB` - Database name
12-
- `POSTGRES_USER` - Database user
13-
- `POSTGRES_PASSWORD` - Database user's password
10+
- [.env.db.example](./../../.env.db.example)
11+
- [.env.backup-restore.example](./../../.env.backup-restore.example)
12+
- [.env.cloudprovider.example](./../../.env.cloudprovider.example)
1413

15-
The following env variables are according to which cloud provider you are going to use:
16-
17-
- `CLOUDPROVIDER`, eg. `aws` or `gcp`
18-
19-
In case AWS:
20-
21-
- `AWS_S3_BUCKET` e.g `s3://osm-seed-test`
22-
23-
In case GCP:
24-
25-
- `GCP_STORAGE_BUCKET` e.g `gs://osm-seed-test`
26-
27-
*Database action*
28-
29-
- `DB_ACTION` e.g `backup` or `restore`
30-
31-
Change the `DB_ACTION` variable to restore or backup the database. `DB_ACTION` = `restore` or `backup`
32-
33-
### Building the container
34-
35-
```
36-
cd db-backup-restore/
37-
docker network create osm-seed_default
38-
docker build -t osmseed-db-backup-restore:v1 .
39-
```
14+
**Note**: Make a copy and rename the files as `.env.db`, `.env.backup-restore` and `.env.cloudprovider`
4015

4116
### Running the container
4217

43-
18+
```sh
19+
# Docker compose
20+
docker-compose run db-backup-restore
21+
22+
# Docker compose
23+
docker run \
24+
--env-file ./../.env.db \
25+
--env-file ./../.env.backup-restore \
26+
--env-file ./../.env.cloudprovider \
27+
--network osm-seed_default \
28+
-it osmseed-db-backup-restore:v1
4429
```
45-
docker run \
46-
--env-file ./../.env \
47-
--network osm-seed_default \
48-
-it osmseed-db-backup-restore:v1
49-
```
30+

0 commit comments

Comments
 (0)