-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
58 lines (56 loc) · 1.63 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
46
47
48
49
50
51
52
53
54
55
56
57
58
version: '3.4'
services:
rattic:
build:
context: .
dockerfile: "Dockerfile.python"
args:
rattic_backup_dir: $rattic_backup_dir
rattic_git_repo: $rattic_git_repo
postgresql_version: $postgresql_version
restart: "no"
volumes:
- ./rattic_public.key:/opt/rattic_public.key
# this is for recovery
- ./rattic_private.key:/opt/rattic_private.key
- ./backup:$rattic_backup_dir
- rattic-static:/opt/rattic/static
- rattic-media:/opt/rattic/media
- rattic-uploads:/opt/rattic/uploads
- rattic-gnupg:/home/rattic/.gnupg
env_file:
- .rattic-env
environment:
rattic_backup_dir: $rattic_backup_dir
rattic_hostname: $http_hostname
depends_on:
- postgresql
postgresql:
image: postgres:$postgresql_version
restart: "no"
volumes:
- postgres-data:/var/lib/postgresql/data/
- ./postgresql-init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
env_file:
- .rattic-env
environment:
POSTGRES_PASSWORD: $postgresql_pwd
nginx:
image: nginx:1.17.10
ports:
- "127.0.0.1:$http_port:80"
environment:
rattic_hostname: $http_hostname
volumes:
- ./nginx-site:/opt/nginx-site
- rattic-static:/srv/rattic/static:ro
- rattic-media:/srv/rattic/media:ro
- rattic-uploads:/srv/rattic/uploads:ro
# see nginx docker doc
command: /bin/bash -c "envsubst '$$rattic_hostname' < /opt/nginx-site > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
volumes:
postgres-data:
rattic-static:
rattic-media:
rattic-uploads:
rattic-gnupg: