This repository has been archived on 2023-02-05. You can view files and clone it, but cannot push or open issues or pull requests.
pyinfra-linkding/group_data/all.py
2021-11-23 12:09:29 +09:00

45 lines
No EOL
1.2 KiB
Python

app = {
'name': 'linkding',
'deps': ['skopeo', 'curl'],
'image': 'docker://sissbruecker/linkding:latest',
}
undocker = {
'url': 'https://git.sr.ht/~motiejus/undocker/refs/download/v1.0.2/undocker-linux-amd64-v1.0.2',
'sha256': 'b937e69e774c530c080c1f6685763ca7db4dc58520a5a2054d111e1504f47688',
'bin_path': '/usr/local/bin/undocker',
'app_dst': f"/opt/{app['name']}",
'cache': '/var/cache/undocker',
}
unix_account = {
'user': app['name'],
'group': app['name'],
'home': f"/home/{app['name']}",
'shell': '/bin/false',
}
data_directories = {
f"{unix_account['home']}/data": '/etc/linkding/data'
}
systemd = {
'Description': app['name'],
'User': unix_account['user'],
'Group': unix_account['group'],
'EnvironmentFile': f"/etc/{app['name']}.env",
'WorkingDirectory': f"/etc/{app['name']}",
'RootDirectory': f"{undocker['app_dst']}",
'ReadWritePaths': [
'+/etc/linkding'
],
'BindPaths': [
f"{list(data_directories.items())[0][0]}:{list(data_directories.items())[0][1]}"
],
'BindReadOnlyPaths': [
'/etc/resolv.conf',
'/etc/hosts',
'/proc'
],
'ExecStart': '/etc/linkding/bootstrap.sh',
}