itzg / docker-mc-backup

Provides a side-car container to backup itzg/minecraft-server world data
https://hub.docker.com/r/itzg/mc-backup
MIT License
334 stars 52 forks source link

file_env: replace common AWS env with secrets #155

Closed KevM closed 1 year ago

KevM commented 1 year ago

This change adds support to follow the ENV_FILE pattern for popular credentials like:

There are likely many others which could be added.

An example _dockercompose.yml would look something like this:

services:
  backups:
    image: itzg/mc-backup
    environment:
      BACKUP_INTERVAL: "1h"
      RCON_HOST: mc
      BACKUP_NAME: mc
      BACKUP_METHOD: restic
      RESTIC_PASSWORD_FILE: /run/secrets/restic_password 
      AWS_ACCESS_KEY_ID_FILE: /run/secrets/aws_access_key_id  
      AWS_SECRET_ACCESS_KEY_FILE: /run/secrets/aws_secret_access_key 
    secrets:
      - aws_access_key
      - aws_secret_access_key
      - restic_password
 secrets:
  aws_access_key:
    file: ../secrets/aws_access_key.txt
  aws_secret_access_key:
    file: ../secrets/aws_secret_access_key.txt
  restic_password:
    file: ../secrets/restic_password.txt