-
Notifications
You must be signed in to change notification settings - Fork 56
/
docker-compose.yml
45 lines (43 loc) · 1.66 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## docker-compose Bareos database migration from MySQL to PostgreSQL
version: '3'
services:
bareos-dbcopy:
image: barcus/bareos-db-migration
volumes:
- /data/mysql/backup:/backup
environment:
- DB_INIT=true # init new PostgreSQL database (required if it does not already exist)
- DB_BACKUP=false # backup MySQL database before migration (optional)
- MYSQL_DB_HOST=bareos-db-mysql
- MYSQL_DB_PORT=3306
- MYSQL_DB_NAME=bareos
- MYSQL_DB_USER=bareos
- MYSQL_DB_PASSWORD=${MYSQL_DB_PASSWORD} # defined in .env file
- PGSQL_DB_HOST=bareos-db-pgsql
- PGSQL_DB_PORT=5432
- PGSQL_DB_NAME=bareos
- PGSQL_DB_USER=bareos
- PGSQL_DB_PASSWORD=${PGSQL_DB_PASSWORD} # defined in .env file
# Required to init new PGSQL instance + DB
- PGSQL_ADMIN_USER=root
- PGSQL_ADMIN_PASSWORD=${PGSQL_ADMIN_PASSWORD} # defined in .env file
- MYSQL_ADMIN_USER=root
- MYSQL_ADMIN_PASSWORD=${MYSQL_ADMIN_PASSWORD} # defined in .env file
depends_on:
- bareos-db-mysql
- bareos-db-pgsql
bareos-db-mysql:
image: mysql:5.6
volumes:
- /data/mysql/data:/var/lib/mysql # /data/mysql/data should contain MySQL DBs (source)
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ADMIN_PASSWORD} # defined in .env file
bareos-db-pgsql:
image: postgres:12
volumes:
- /data/pgsql/data:/var/lib/postgresql/data # /data/pgsql/data will contains PgSQL DBs (target)
environment:
- POSTGRES_USER=postgres # postgres user with superuser role
- POSTGRES_PASSWORD=${PGSQL_ADMIN_PASSWORD} # defined in .env file
- POSTGRES_INITDB_ARGS=--encoding=SQL_ASCII
#EOF