A docker container for routinely archiving Scryfall's Magic: The Gathering database.
To run Scryfall Archiver, simply use the following docker-compose, with any changes you would like to make:
name: scryfall-archiver
services:
postgres:
image: 'postgres:latest'
build:
context: ./
dockerfile: ./Dockerfile
ports:
- 5432:5432
restart: unless-stopped
volumes:
- /YOUR/DATA/PATH/db/pg-data/:/var/lib/postgresql/data/
environment:
POSTGRES_USER: username # The PostgreSQL user (useful to connect to the database)
POSTGRES_PASSWORD: password # The PostgreSQL password (useful to connect to the database)
scryfall-archiver:
container_name: scryfall-archiver
image: index.docker.io/travislane/scryfall-archiver:latest
environment:
SA_DATA_DIR: /data
SA_ARCHIVE_SCHEDULE: "0 2 1 * *"
SA_BACKUP_SMALL_IMAGE: false
SA_BACKUP_NORMAL_IMAGE: false
SA_BACKUP_LARGE_IMAGE: false
SA_BACKUP_PNG_IMAGE: true
SA_BACKUP_ART_CROP_IMAGE: false
SA_BACKUP_BORDER_CROP_IMAGE: false
POSTGRES_USER: username # MUST MATCH THE VALUES USED FOR 'postgres'
POSTGRES_PASSWORD: password # MUST MATCH THE VALUES USED FOR 'postgres'
SA_VERSION: "1.0.0"
RUST_LOG: info
volumes:
- /YOUR/DATA/PATH:/data
restart: unless-stopped
healthcheck:
disable: false| Variable | Required | Description |
|---|---|---|
SA_DATA_DIR |
No | The directory where data is saved. Changing this means you need to change where your Data volume is mounted to |
SA_ARCHIVE_SCHEDULE |
No | A CRON schedule for archiving data. By default it is set to once a month. Anything more than weekly is probably excessive |
SA_BACKUP_SMALL_IMAGE |
Yes | Whether to download the small image for each card |
SA_BACKUP_NORMAL_IMAGE |
Yes | Whether to download the normal image for each card |
SA_BACKUP_LARGE_IMAGE |
Yes | Whether to download the large image for each card |
SA_BACKUP_PNG_IMAGE |
Yes | Whether to download the png image for each card |
SA_BACKUP_ART_CROP_IMAGE |
Yes | Whether to download the art_crop image for each card |
SA_BACKUP_BORDER_CROP_IMAGE |
Yes | Whether to download the border_crop image for each card |
POSTGRES_USER |
Yes | The Postgres DB username |
POSTGRES_PASSWORD |
Yes | The Postgres DB password |
SA_VERSION |
No | The Archiver Version |
RUST_LOG |
No | The log level |
| Volume | Mount Point | Description |
|---|---|---|
| Data | /data |
This is where all of the archived data will be stored. |
| pg-data | /var/lib/postgresql/data |
This is where all of the postgres data will be stored. |
- This program is licensed under the GNU General Public License Version 3
- Please provide appropriate credit for code usage
Copyright Travis Lane