-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-nextcloud-pgsql.yml
135 lines (129 loc) · 3.39 KB
/
docker-compose-nextcloud-pgsql.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: "3.9"
volumes:
# Volume für Postgre-SQL und Postgre-Admin
pgdb:
pgadmin:
networks:
# Die Netzwerke erstellt vom NginX Proxy Manager
nginx_proxy_frontend:
# add this if the network is already existing!
external: true
nginx_proxy_backend:
# add this if the network is already existing!
external: true
services:
nextcloud-db:
container_name: ${P_HOST}
hostname: ${P_HOST}
image: postgres:alpine
restart: always
volumes:
- pgdb:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
environment:
# Postgre-SQL Environment
POSTGRES_PASSWORD: ${P_PW}
POSTGRES_DB: ${P_DB}
POSTGRES_USER: ${P_U}
healthcheck:
# Healthcheck für den Datenbank Container
test: ["CMD-SHELL", "pg_isready"]
interval: 30s
timeout: 5s
retries: 5
ports:
- '${P_PORT}:5432'
networks:
- nginx_proxy_backend
nextcloud-redis:
image: redis:alpine
container_name: ${R_CONTAINER}
hostname: ${R_HOST}
networks:
- nginx_proxy_backend
restart: unless-stopped
#Redis Passwort eingeben
command: redis-server --requirepass ${R_PW}
# Optional
nextcloud-pgadmin:
container_name: ${PGADMIN_CONTAINER}
depends_on:
- ${R_HOST}
- ${R_CONTAINER}
image: dpage/pgadmin4:latest
environment:
# PGADMIN Environment
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_CONFIG_SERVER_MODE: 'False'
POSTGRES_HOST: nc-postgres
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT}:80"
networks:
- nginx_proxy_frontend
- nginx_proxy_backend
restart: unless-stopped
#############
nextcloud-app:
container_name: nc-app
depends_on:
- ${P_HOST}
- ${R_CONTAINER}
build:
context: .
dockerfile: docker_nc_pgsql_app
restart: always
deploy:
resources:
limits:
memory: 2048M
reservations:
memory: 500M
ports:
- '${NC_PORT}:80'
volumes:
- type: bind
source: ${NC_SOURCE}
target: /var/www/html
- type: bind
source: ${NC_DATA_SOURCE}
target: /var/www/html/data
- type: bind
source: ${NC_SOURCE}/custom_apps
target: /var/www/html/custom_apps
- type: bind
source: ${NC_SOURCE}/config
target: /var/www/html/config
healthcheck:
# Healthcheck Nextcloud
test: curl --fail http://localhost || exit 1
interval: 30s
retries: 5
timeout: 10s
environment:
REDIS_HOST: ${R_HOST}
# Redis Passwort von oben wieder eingeben
REDIS_HOST_PASSWORD: ${R_PW}
POSTGRES_PASSWORD: ${P_PW}
POSTGRES_DB: ${P_DB}
POSTGRES_USER: ${P_U}
POSTGRES_HOST: ${P_HOST}
POSTGRES_DB_PORT: ${P_PORT}
# Set overwriteprotocol to https to fix Remote Proxy Failure
NC_overwriteprotocol: https
# Set default_phone_region to DE=Germany
NC_default_phone_region: DE
# Set Default EMail Config
SMTP_HOST: ${S_H}
SMTP_SECURE: SSL
SMTP_PORT: 465
SMTP_NAME: ${S_U}
SMTP_PASSWORD: ${S_PW}
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS}
MAIL_DOMAIN: ${MAIL_DOMAIN}
networks:
- nginx_proxy_frontend
- nginx_proxy_backend