123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- version: '2'
- volumes:
- database:
- host_keys:
- authorized_keys:
- services:
- sample_database:
- image: mariadb:10.4
- environment:
- MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
- MYSQL_USER: someone
- MYSQL_PASSWORD: secret
- MYSQL_DATABASE: demo
- # https://github.com/docker-library/mariadb/issues/251
- # https://github.com/docker-library/mariadb/issues/262#issuecomment-536405303
- MYSQL_INITDB_SKIP_TZINFO: 1
- volumes:
- - database:/var/lib/mysql:rw
- sshd:
- build: .
- image: fphammerle/mysqldump-sshd
- environment:
- MYSQLDUMP_ARGS: >-
- --host=sample_database
- --user=someone
- --password=secret
- --skip-add-drop-table
- --skip-comments
- --skip-dump-date
- --databases demo
- volumes:
- - host_keys:/etc/ssh/host_keys:rw
- - authorized_keys:/home/dump/.ssh:ro
- tmpfs:
- - /tmp:nosuid,nodev,exec,size=4k # /tmp/mysqldump.sh
- read_only: true
- ports:
- - 127.0.0.1:2222:2222
- security_opt: ['no-new-privileges']
- # strace
- # cap_add: [SYS_PTRACE]
- # https://docs.docker.com/compose/compose-file/compose-file-v2/
|