Cambios para el documento Instalacion (docker)
Última modificación por dFa el 2025/02/24 10:01
Resumen
-
Propiedades de página (1 modificado, 0 añadido, 0 eliminado)
-
Adjuntos (0 modificado, 0 añadido, 6 eliminado)
Detalles
- Propiedades de página
-
- Contenido
-
... ... @@ -8,9 +8,6 @@ 8 8 ))) 9 9 ))) 10 10 11 ----- 12 - 13 - 14 14 {{toc/}} 15 15 16 16 (% class="row" %) ... ... @@ -17,19 +17,10 @@ 17 17 ((( 18 18 (% class="col-xs-12 col-sm-8" %) 19 19 ((( 20 ----- 21 - 22 22 = INICIO = 23 23 24 -== Instalaci ón ==19 +== Instalacion == 25 25 26 -La instalación consta de 4 servicios: 27 - 28 -* db: Base de datos mariadb 29 -* redes: Base de datos de memoria caché redis 30 -* app: Aplicativo nextcloud 31 -* web: Servidor web nginx 32 - 33 33 El primer paso es generar nuestro docker-compose: 34 34 35 35 {{code language="yaml"}} ... ... @@ -101,231 +101,13 @@ 101 101 driver: local 102 102 {{/code}} 103 103 104 -Los volúmenes se han configurado por las siguientes razones: 105 105 106 -* database: Ficheros de la base de datos mysql 107 -* redis: Ficheros de la base de datos redes 108 -* data: Ficheros del aplicativo nextcloud (es necesario que lo usen tanto el contenedor app como el contenedor web) 109 -* user: Ficheros de los perfiles de usuarios creados para nextcloud 110 -* nginx_conf: Fichero nginx.conf 111 111 112 -Además, en este caso, se ha realizado un bind de nuestro disco /datos para que sea utilizado como punto de montaje en nextcloud. Dado que es un contenedor, es necesario mapearlo para que la interfaz web tenga acceso al recurso de alguna manera. 113 113 114 -Desplegamos los contenedores: 115 - 116 -[[image:1740216653242-590.png]] 117 - 118 -Y vemos que se han creado los volumenes correctamente: 119 - 120 -[[image:1740216641833-376.png]] 121 - 122 -== Configuración == 123 - 124 -Con los volumenes creados, todavía nextcloud no es accesible, dado que debemos configurar tanto el config.php como como el nginx.conf. 125 - 126 -=== nginx.conf === 127 - 128 -El fichero nginx.conf se encuentra en el volumen nextcloud_nginx_conf. Realizamos previamente un backup y reemplazamos por el siguiente: 129 - 130 -{{code language="yaml"}} 131 -worker_processes auto; 132 - 133 -error_log /var/log/nginx/error.log warn; 134 -pid /var/run/nginx.pid; 135 - 136 -events { 137 - worker_connections 1024; 138 -} 139 - 140 -http { 141 - include mime.types; 142 - default_type application/octet-stream; 143 - types { 144 - text/javascript mjs; 145 - application/wasm wasm; 146 - } 147 - 148 - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 149 - '$status $body_bytes_sent "$http_referer" ' 150 - '"$http_user_agent" "$http_x_forwarded_for"'; 151 - 152 - access_log /var/log/nginx/access.log main; 153 - 154 - sendfile on; 155 - keepalive_timeout 65; 156 - 157 - # Define asset_immutable variable properly 158 - map $arg_v $asset_immutable { 159 - default ""; 160 - "" ", immutable"; 161 - } 162 - 163 - upstream php-handler { 164 - server app:9000; 165 - } 166 - 167 - server { 168 - listen 80; 169 - 170 - client_max_body_size 512M; 171 - client_body_timeout 300s; 172 - fastcgi_buffers 64 4K; 173 - 174 - client_body_buffer_size 512k; 175 - 176 - gzip on; 177 - gzip_vary on; 178 - gzip_comp_level 4; 179 - gzip_min_length 256; 180 - gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; 181 - gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; 182 - 183 - add_header Referrer-Policy "no-referrer" always; 184 - add_header X-Content-Type-Options "nosniff" always; 185 - add_header X-Frame-Options "SAMEORIGIN" always; 186 - add_header X-Permitted-Cross-Domain-Policies "none" always; 187 - add_header X-Robots-Tag "noindex, nofollow" always; 188 - add_header X-XSS-Protection "1; mode=block" always; 189 - 190 - fastcgi_hide_header X-Powered-By; 191 - 192 - root /var/www/html; 193 - 194 - index index.php index.html /index.php$request_uri; 195 - 196 - location = / { 197 - if ( $http_user_agent ~ ^DavClnt ) { 198 - return 302 /remote.php/webdav/$is_args$args; 199 - } 200 - } 201 - 202 - location = /robots.txt { 203 - allow all; 204 - log_not_found off; 205 - access_log off; 206 - } 207 - 208 - location ^~ /.well-known { 209 - location = /.well-known/carddav { return 301 /remote.php/dav/; } 210 - location = /.well-known/caldav { return 301 /remote.php/dav/; } 211 - location /.well-known/acme-challenge { try_files $uri $uri/ =404; } 212 - location /.well-known/pki-validation { try_files $uri $uri/ =404; } 213 - return 301 /index.php$request_uri; 214 - } 215 - 216 - location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } 217 - location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } 218 - 219 - location ~ \.php(?:$|/) { 220 - rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri; 221 - 222 - fastcgi_split_path_info ^(.+?\.php)(/.*)$; 223 - set $path_info $fastcgi_path_info; 224 - 225 - try_files $fastcgi_script_name =404; 226 - 227 - include fastcgi_params; 228 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 229 - fastcgi_param PATH_INFO $path_info; 230 - fastcgi_param HTTPS on; 231 - 232 - fastcgi_param modHeadersAvailable true; 233 - fastcgi_param front_controller_active true; 234 - fastcgi_pass php-handler; 235 - 236 - fastcgi_intercept_errors on; 237 - fastcgi_request_buffering off; 238 - 239 - fastcgi_max_temp_file_size 0; 240 - } 241 - 242 - location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ { 243 - try_files $uri /index.php$request_uri; 244 - add_header Cache-Control "public, max-age=15778463$asset_immutable"; 245 - access_log off; 246 - } 247 - 248 - location ~ \.wasm$ { 249 - default_type application/wasm; 250 - } 251 - 252 - location /remote { 253 - return 301 /remote.php$request_uri; 254 - } 255 - 256 - location / { 257 - try_files $uri $uri/ /index.php$request_uri; 258 - } 259 - } 260 -} 261 -{{/code}} 262 - 263 -=== config.php === 264 - 265 -Hacemos lo mismo con el fichero config.php que se encuentra en el volumen app dentro del directorio config: 266 - 267 -{{code language="php"}} 268 -<?php 269 -$CONFIG = array ( 270 - 'memcache.local' => '\\OC\\Memcache\\APCu', 271 - 'apps_paths' => 272 - array ( 273 - 0 => 274 - array ( 275 - 'path' => '/var/www/html/apps', 276 - 'url' => '/apps', 277 - 'writable' => true, 278 - ), 279 - 1 => 280 - array ( 281 - 'path' => '/var/www/html/custom_apps', 282 - 'url' => '/custom_apps', 283 - 'writable' => true, 284 - ), 285 - ), 286 - 'memcache.distributed' => '\\OC\\Memcache\\Redis', 287 - 'memcache.locking' => '\\OC\\Memcache\\Redis', 288 - 'redis' => 289 - array ( 290 - 'host' => 'redis', 291 - 'password' => '', 292 - 'port' => 6379, 293 - ), 294 - 'upgrade.disable-web' => true, 295 - 'instanceid' => 'ocxuwrcpcats', 296 - 'passwordsalt' => 'bFuPjx3NMpliQCtY729Uob2SRp19xe', 297 - 'secret' => 'eFMG77LAdbjw6oPSJM7hL/IDPBnP3qDxE7xlX6/uPMOvQ/kG', 298 - 'trusted_domains' => 299 - array ( 300 - 0 => '10.100.200.35:8080', 301 - 1 => 'dfacloud.ddns.net', 302 - 303 - ), 304 - 'datadirectory' => '/var/nextcloud/data', 305 - 'dbtype' => 'mysql', 306 - 'version' => '30.0.6.2', 307 - 'overwrite.cli.url' => 'https://dfacloud.ddns.net', 308 - 'dbname' => 'nextcloud', 309 - 'dbhost' => 'db', 310 - 'dbport' => '', 311 - 'dbtableprefix' => 'oc_', 312 - 'mysql.utf8mb4' => true, 313 - 'dbuser' => 'nextcloud', 314 - 'dbpassword' => 'Ko5b0sq977j1saaCQ3SD55', 315 - 'installed' => true, 316 -); 317 -{{/code}} 318 - 319 -En este fichero php tendremos que tener en cuenta modificar los valores nuestra dirección ip:puerto y nuestra dns en consecuencia. 320 - 321 - 322 322 323 323 ))) 324 324 325 325 326 - 327 - 328 - 329 329 (% class="col-xs-12 col-sm-4" %) 330 330 ((( 331 331
- 1740216568396-284.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -19.9 KB - Contenido
- 1740216585269-265.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -19.9 KB - Contenido
- 1740216587698-323.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -19.9 KB - Contenido
- 1740216603834-462.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -21.8 KB - Contenido
- 1740216641833-376.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -4.6 KB - Contenido
- 1740216653242-590.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.dFa - Tamaño
-
... ... @@ -1,1 +1,0 @@ 1 -19.9 KB - Contenido