forked from photoview/photoview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (117 loc) · 4.8 KB
/
Copy pathdocker-compose.yml
File metadata and controls
121 lines (117 loc) · 4.8 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
services:
photoview:
image: viktorstrate/photoview:2
labels:
- "com.centurylinklabs.watchtower.enable=true"
hostname: photoview
container_name: photoview
restart: unless-stopped
stop_grace_period: 10s
ports:
- "8000:80" ## HTTP port (host:container)
security_opt:
- seccomp:unconfined
- apparmor:unconfined
environment:
PHOTOVIEW_DATABASE_DRIVER: sqlite
PHOTOVIEW_SQLITE_PATH: /home/photoview/database/photoview.db
PHOTOVIEW_LISTEN_IP: "photoview"
MAPBOX_TOKEN: ${MAPBOX_TOKEN}
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/home/photoview/database:/home/photoview/database"
- "/home/photoview/storage:/home/photoview/media-cache"
- "/home/photoview/media:/photos:ro"
entrypoint: >
sh -c "
mkdir -p /home/photoview/media &&
chmod -R 755 /home/photoview/media &&
exec /app/photoview
"
## Watchtower upgrades services automatically (optional)
watchtower:
image: containrrr/watchtower:latest
hostname: watchtower
container_name: watchtower
restart: unless-stopped
environment:
## Comment out the next variable if you want Watchtower to auto-update all containers, running on the host,
## while now it will update only those with the label "com.centurylinklabs.watchtower.enable=true"
WATCHTOWER_LABEL_ENABLE: true
WATCHTOWER_CLEANUP: ${WATCHTOWER_CLEANUP}
WATCHTOWER_POLL_INTERVAL: ${WATCHTOWER_POLL_INTERVAL}
WATCHTOWER_TIMEOUT: ${WATCHTOWER_TIMEOUT}
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "~/.docker/config.json:/config.json:ro" ## optional, for authentication if you have a Docker Hub account
- "/etc/localtime:/etc/localtime:ro" ## use local time from host
- "/etc/timezone:/etc/timezone:ro" ## use timezone from host
## Comment out the `mariadb` service if PHOTOVIEW_DATABASE_DRIVER is set to `sqlite` or `postgres` in the .env
# mariadb:
# image: mariadb:lts
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
# hostname: photoview-mariadb
# container_name: photoview-mariadb
# restart: unless-stopped
# stop_grace_period: 5s
# ## Optimized MariaDB startup command for better performance and compatibility
# command: mariadbd --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
# security_opt: ## see https://github.com/MariaDB/mariadb-docker/issues/434#issuecomment-1136151239
# - seccomp:unconfined
# - apparmor:unconfined
# ## Uncomment next 2 lines if you want to access the database directly
# # ports:
# # - "3306:3306"
# environment:
# MARIADB_AUTO_UPGRADE: "1"
# MARIADB_DATABASE: ${MARIADB_DATABASE}
# MARIADB_USER: ${MARIADB_USER}
# MARIADB_PASSWORD: ${MARIADB_PASSWORD}
# MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
# volumes:
# ## Example:
# ## - "/host/folder:/container/folder"
# - "/etc/localtime:/etc/localtime:ro" ## use local time from host
# - "/etc/timezone:/etc/timezone:ro" ## use timezone from host
# - "${HOST_PHOTOVIEW_LOCATION}/database/mariadb:/var/lib/mysql" ## DO NOT REMOVE
# healthcheck:
# test: healthcheck.sh --connect --innodb_initialized
# interval: 1m
# timeout: 5s
# retries: 5
# start_period: 3m
## Uncomment the `postgres` service if PHOTOVIEW_DATABASE_DRIVER is set to `postgres` in the .env
# postgres:
# image: postgres:16-alpine
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
# hostname: photoview-pgsql
# container_name: photoview-pgsql
# restart: unless-stopped
# stop_grace_period: 5s
# ## Security options for some restricted systems
# security_opt:
# - seccomp:unconfined
# - apparmor:unconfined
# ## Uncomment next 2 lines if you want to access the database directly
# # ports:
# # - 5432:5432
# environment:
# POSTGRES_DB: ${PGSQL_DATABASE}
# POSTGRES_USER: ${PGSQL_USER}
# POSTGRES_PASSWORD: ${PGSQL_PASSWORD}
# ## See other optional variables in the https://hub.docker.com/_/postgres
# volumes:
# ## Example:
# ## - "/host/folder:/container/folder"
# - "/etc/localtime:/etc/localtime:ro" ## use local time from host
# - "/etc/timezone:/etc/timezone:ro" ## use timezone from host
# - "${HOST_PHOTOVIEW_LOCATION}/database/postgres:/var/lib/postgresql/data" ## DO NOT REMOVE
# healthcheck:
# test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB
# interval: 1m
# timeout: 5s
# retries: 5
# start_period: 3m