├── 21 ├── apache │ ├── Dockerfile │ ├── config │ │ ├── apache-pretty-urls.config.php │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── fpm-alpine │ ├── Dockerfile │ ├── config │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude └── fpm │ ├── Dockerfile │ ├── config │ ├── apcu.config.php │ ├── apps.config.php │ ├── autoconfig.php │ ├── redis.config.php │ ├── reverse-proxy.config.php │ ├── s3.config.php │ ├── smtp.config.php │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── 22 ├── apache │ ├── Dockerfile │ ├── config │ │ ├── apache-pretty-urls.config.php │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── fpm-alpine │ ├── Dockerfile │ ├── config │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude └── fpm │ ├── Dockerfile │ ├── config │ ├── apcu.config.php │ ├── apps.config.php │ ├── autoconfig.php │ ├── redis.config.php │ ├── reverse-proxy.config.php │ ├── s3.config.php │ ├── smtp.config.php │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── 23 ├── apache │ ├── Dockerfile │ ├── config │ │ ├── apache-pretty-urls.config.php │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── fpm-alpine │ ├── Dockerfile │ ├── config │ │ ├── apcu.config.php │ │ ├── apps.config.php │ │ ├── autoconfig.php │ │ ├── redis.config.php │ │ ├── reverse-proxy.config.php │ │ ├── s3.config.php │ │ ├── smtp.config.php │ │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude └── fpm │ ├── Dockerfile │ ├── config │ ├── apcu.config.php │ ├── apps.config.php │ ├── autoconfig.php │ ├── redis.config.php │ ├── reverse-proxy.config.php │ ├── s3.config.php │ ├── smtp.config.php │ └── swift.config.php │ ├── cron.sh │ ├── entrypoint.sh │ └── upgrade.exclude ├── .config ├── apache-pretty-urls.config.php ├── apcu.config.php ├── apps.config.php ├── autoconfig.php ├── redis.config.php ├── reverse-proxy.config.php ├── s3.config.php ├── smtp.config.php └── swift.config.php ├── .examples ├── README.md ├── docker-compose │ ├── insecure │ │ ├── mariadb │ │ │ ├── apache │ │ │ │ ├── db.env │ │ │ │ └── docker-compose.yml │ │ │ └── fpm │ │ │ │ ├── db.env │ │ │ │ ├── docker-compose.yml │ │ │ │ └── web │ │ │ │ ├── Dockerfile │ │ │ │ └── nginx.conf │ │ └── postgres │ │ │ ├── apache │ │ │ ├── db.env │ │ │ └── docker-compose.yml │ │ │ └── fpm │ │ │ ├── db.env │ │ │ ├── docker-compose.yml │ │ │ └── web │ │ │ ├── Dockerfile │ │ │ └── nginx.conf │ └── with-nginx-proxy │ │ ├── mariadb │ │ ├── apache │ │ │ ├── db.env │ │ │ ├── docker-compose.yml │ │ │ └── proxy │ │ │ │ ├── Dockerfile │ │ │ │ └── uploadsize.conf │ │ └── fpm │ │ │ ├── db.env │ │ │ ├── docker-compose.yml │ │ │ ├── proxy │ │ │ ├── Dockerfile │ │ │ └── uploadsize.conf │ │ │ └── web │ │ │ ├── Dockerfile │ │ │ └── nginx.conf │ │ └── postgres │ │ ├── apache │ │ ├── db.env │ │ ├── docker-compose.yml │ │ └── proxy │ │ │ ├── Dockerfile │ │ │ └── uploadsize.conf │ │ └── fpm │ │ ├── db.env │ │ ├── docker-compose.yml │ │ ├── proxy │ │ ├── Dockerfile │ │ └── uploadsize.conf │ │ └── web │ │ ├── Dockerfile │ │ └── nginx.conf └── dockerfiles │ ├── cron │ ├── apache │ │ ├── Dockerfile │ │ └── supervisord.conf │ ├── fpm-alpine │ │ ├── Dockerfile │ │ └── supervisord.conf │ └── fpm │ │ ├── Dockerfile │ │ └── supervisord.conf │ ├── full │ ├── apache │ │ ├── Dockerfile │ │ └── supervisord.conf │ ├── fpm-alpine │ │ ├── Dockerfile │ │ └── supervisord.conf │ └── fpm │ │ ├── Dockerfile │ │ └── supervisord.conf │ ├── imap │ ├── apache │ │ └── Dockerfile │ ├── fpm-alpine │ │ └── Dockerfile │ └── fpm │ │ └── Dockerfile │ └── smb │ ├── apache │ └── Dockerfile │ ├── fpm-alpine │ └── Dockerfile │ └── fpm │ └── Dockerfile ├── .github ├── ISSUE_TEMPLATE │ ├── Image_issue.md │ └── config.yml └── workflows │ ├── images.yml │ └── update-sh.yml ├── .travis └── test-example-dockerfiles.sh ├── CODE_OF_CONDUCT.md ├── Dockerfile-alpine.template ├── Dockerfile-debian.template ├── LICENSE.md ├── README.md ├── docker-cron.sh ├── docker-entrypoint.sh ├── generate-stackbrew-library.sh ├── latest.txt ├── logo.svg ├── stack.yml ├── update.sh └── upgrade.exclude /.config/apache-pretty-urls.config.php: -------------------------------------------------------------------------------- 1 | '/', 4 | ); 5 | -------------------------------------------------------------------------------- /.config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /.config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /.config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /.config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /.examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples section 2 | 3 | In this subfolders are some examples how to use the docker image. There are two sections: 4 | 5 | * [`dockerfiles`](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles) 6 | * [`docker-compose`](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose) 7 | 8 | The `dockerfiles` are derived images, that add or alter certain functionalities of the default docker images. In the `docker-compose` subfolder are examples for deployment of the application, including database, redis, collabora and other services. 9 | 10 | ## Dockerfiles 11 | The Dockerfiles use the default images as base image and build on top of it. 12 | 13 | 14 | Example | Description 15 | ------- | ------- 16 | [cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed). This image runs `supervisord` to start nextcloud and cron as two seperate processes inside the container. 17 | [imap](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/imap) | adds dependencies required to authenticate users via imap 18 | [smb](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/smb) | adds dependencies required to use smb shares 19 | [full](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/full) | adds dependencies for ALL optional packages and cron functionality via supervisor (as in the `cron` example Dockerfile). 20 | 21 | ### full 22 | The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html). 23 | 24 | NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the appropriate line in the Dockerfile. 25 | 26 | NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews) 27 | 28 | NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors. 29 | 30 | The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile. 31 | 32 | #### PHP Module bz2 33 | `docker-php-ext-install bz2` 34 | 35 | #### PHP Module imap 36 | `apt install libc-client-dev libkrb5-dev` 37 | `docker-php-ext-configure imap --with-kerberos --with-imap-ssl` 38 | `docker-php-ext-install imap` 39 | 40 | #### PHP Module gmp 41 | `apt install libgmp3-dev` 42 | `docker-php-ext-install gmp` 43 | 44 | #### PHP Module smbclient 45 | `apt install smbclient libsmbclient-dev` 46 | `pecl install smbclient` 47 | `docker-php-ext-enable smbclient` 48 | 49 | #### ffmpeg 50 | `apt install ffmpeg` 51 | 52 | #### imagemagick SVG support 53 | `apt install libmagickcore-6.q16-6-extra` 54 | 55 | #### LibreOffice 56 | `apt install libreoffice` 57 | 58 | #### CRON via supervisor 59 | `apt install supervisor` 60 | `mkdir /var/log/supervisord /var/run/supervisord` 61 | The following Dockerfile commands are also necessary for a sucessfull cron installation: 62 | `COPY supervisord.conf /etc/supervisor/supervisord.conf` 63 | `CMD ["/usr/bin/supervisord"]` 64 | 65 | 66 | 67 | ## docker-compose 68 | In `docker-compose` additional services are bundled to create a complete nextcloud installation. The examples are designed to run out-of-the-box. 69 | Before running the examples you have to modify the `db.env` and `docker-compose.yml` file and fill in your custom information. 70 | 71 | The docker-compose examples make heavily use of derived Dockerfiles to add configuration files into the containers. This way they should also work on remote docker systems as _Docker for Windows_. When running docker-compose on the same host as the docker daemon, another possibility would be to simply mount the files in the volumes section in the `docker-compose.yml` file. 72 | 73 | 74 | ### insecure 75 | This example should only be used for testing on the local network because it uses a unencrypted http connection. 76 | When you want to have your server reachable from the internet adding HTTPS-encryption is mandatory! 77 | For this use one of the [with-nginx-proxy](#with-nginx-proxy) examples. 78 | 79 | To use this example complete the following steps: 80 | 81 | 1. if you use mariadb or mysql choose a root password for the database in `docker-compose.yml` behind `MYSQL_ROOT_PASSWORD=` 82 | 2. choose a password for the database user nextcloud in `db.env` behind `MYSQL_PASSWORD=` (for mariadb/mysql) or `POSTGRES_PASSWORD=` (for postgres) 83 | 3. run `docker-compose build --pull` to pull the most recent base images and build the custom dockerfiles 84 | 4. start nextcloud with `docker-compose up -d` 85 | 86 | 87 | If you want to update your installation to a newer version of nextcloud, repeat the steps 3 and 4. 88 | 89 | 90 | ### with-nginx-proxy 91 | The nginx proxy adds a proxy layer between nextcloud and the internet. The proxy is designed to serve multiple sites on the same host machine. 92 | 93 | The advantage in adding this layer is the ability to add a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling. 94 | This combination of the [nginxproxy/nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) and [nginxproxy/acme-companion](https://github.com/nginx-proxy/acme-companion) containers creates a fully automated https encryption of the nextcloud installation without worrying about certificate generation, validation or renewal. 95 | 96 | **This setup only works with a valid domain name on a server that is reachable from the internet.** 97 | 98 | To use this example complete the following steps: 99 | 100 | 1. open `docker-compose.yml` 101 | 1. insert your nextcloud domain behind `VIRTUAL_HOST=`and `LETSENCRYPT_HOST=` 102 | 2. enter a valid email behind `LETSENCRYPT_EMAIL=` 103 | 3. if you use mariadb or mysql choose a root password for the database behind `MYSQL_ROOT_PASSWORD=` 104 | 2. choose a password for the database user nextcloud in `db.env` behind `MYSQL_PASSWORD=` (for mariadb/mysql) or `POSTGRES_PASSWORD=` (for postgres) 105 | 3. run `docker-compose build --pull` to pull the most recent base images and build the custom dockerfiles 106 | 4. start nextcloud with `docker-compose up -d` 107 | 108 | 109 | If you want to update your installation to a newer version of nextcloud, repeat the steps 3 and 4. 110 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/apache/db.env: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD= 2 | MYSQL_DATABASE=nextcloud 3 | MYSQL_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: mariadb:10.5 6 | command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW 7 | restart: always 8 | volumes: 9 | - db:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD= 12 | env_file: 13 | - db.env 14 | 15 | redis: 16 | image: redis:alpine 17 | restart: always 18 | 19 | app: 20 | image: nextcloud:apache 21 | restart: always 22 | ports: 23 | - 127.0.0.1:8080:80 24 | volumes: 25 | - nextcloud:/var/www/html 26 | environment: 27 | - MYSQL_HOST=db 28 | - REDIS_HOST=redis 29 | env_file: 30 | - db.env 31 | depends_on: 32 | - db 33 | - redis 34 | 35 | cron: 36 | image: nextcloud:apache 37 | restart: always 38 | volumes: 39 | - nextcloud:/var/www/html 40 | entrypoint: /cron.sh 41 | depends_on: 42 | - db 43 | - redis 44 | 45 | volumes: 46 | db: 47 | nextcloud: 48 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/fpm/db.env: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD= 2 | MYSQL_DATABASE=nextcloud 3 | MYSQL_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: mariadb:10.5 6 | command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW 7 | restart: always 8 | volumes: 9 | - db:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD= 12 | env_file: 13 | - db.env 14 | 15 | redis: 16 | image: redis:alpine 17 | restart: always 18 | 19 | app: 20 | image: nextcloud:fpm-alpine 21 | restart: always 22 | volumes: 23 | - nextcloud:/var/www/html 24 | environment: 25 | - MYSQL_HOST=db 26 | - REDIS_HOST=redis 27 | env_file: 28 | - db.env 29 | depends_on: 30 | - db 31 | - redis 32 | 33 | web: 34 | build: ./web 35 | restart: always 36 | ports: 37 | - 127.0.0.1:8080:80 38 | volumes: 39 | - nextcloud:/var/www/html:ro 40 | depends_on: 41 | - app 42 | 43 | cron: 44 | image: nextcloud:fpm-alpine 45 | restart: always 46 | volumes: 47 | - nextcloud:/var/www/html 48 | entrypoint: /cron.sh 49 | depends_on: 50 | - db 51 | - redis 52 | 53 | volumes: 54 | db: 55 | nextcloud: 56 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/fpm/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | 3 | error_log /var/log/nginx/error.log warn; 4 | pid /var/run/nginx.pid; 5 | 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 17 | '$status $body_bytes_sent "$http_referer" ' 18 | '"$http_user_agent" "$http_x_forwarded_for"'; 19 | 20 | access_log /var/log/nginx/access.log main; 21 | 22 | sendfile on; 23 | #tcp_nopush on; 24 | 25 | keepalive_timeout 65; 26 | 27 | #gzip on; 28 | 29 | upstream php-handler { 30 | server app:9000; 31 | } 32 | 33 | server { 34 | listen 80; 35 | 36 | # HSTS settings 37 | # WARNING: Only add the preload option once you read about 38 | # the consequences in https://hstspreload.org/. This option 39 | # will add the domain to a hardcoded list that is shipped 40 | # in all major browsers and getting removed from this list 41 | # could take several months. 42 | #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; 43 | 44 | # set max upload size 45 | client_max_body_size 512M; 46 | fastcgi_buffers 64 4K; 47 | 48 | # Enable gzip but do not remove ETag headers 49 | gzip on; 50 | gzip_vary on; 51 | gzip_comp_level 4; 52 | gzip_min_length 256; 53 | gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; 54 | gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject 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; 55 | 56 | # Pagespeed is not supported by Nextcloud, so if your server is built 57 | # with the `ngx_pagespeed` module, uncomment this line to disable it. 58 | #pagespeed off; 59 | 60 | # HTTP response headers borrowed from Nextcloud `.htaccess` 61 | add_header Referrer-Policy "no-referrer" always; 62 | add_header X-Content-Type-Options "nosniff" always; 63 | add_header X-Download-Options "noopen" always; 64 | add_header X-Frame-Options "SAMEORIGIN" always; 65 | add_header X-Permitted-Cross-Domain-Policies "none" always; 66 | add_header X-Robots-Tag "none" always; 67 | add_header X-XSS-Protection "1; mode=block" always; 68 | 69 | # Remove X-Powered-By, which is an information leak 70 | fastcgi_hide_header X-Powered-By; 71 | 72 | # Path to the root of your installation 73 | root /var/www/html; 74 | 75 | # Specify how to handle directories -- specifying `/index.php$request_uri` 76 | # here as the fallback means that Nginx always exhibits the desired behaviour 77 | # when a client requests a path that corresponds to a directory that exists 78 | # on the server. In particular, if that directory contains an index.php file, 79 | # that file is correctly served; if it doesn't, then the request is passed to 80 | # the front-end controller. This consistent behaviour means that we don't need 81 | # to specify custom rules for certain paths (e.g. images and other assets, 82 | # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus 83 | # `try_files $uri $uri/ /index.php$request_uri` 84 | # always provides the desired behaviour. 85 | index index.php index.html /index.php$request_uri; 86 | 87 | # Rule borrowed from `.htaccess` to handle Microsoft DAV clients 88 | location = / { 89 | if ( $http_user_agent ~ ^DavClnt ) { 90 | return 302 /remote.php/webdav/$is_args$args; 91 | } 92 | } 93 | 94 | location = /robots.txt { 95 | allow all; 96 | log_not_found off; 97 | access_log off; 98 | } 99 | 100 | # Make a regex exception for `/.well-known` so that clients can still 101 | # access it despite the existence of the regex rule 102 | # `location ~ /(\.|autotest|...)` which would otherwise handle requests 103 | # for `/.well-known`. 104 | location ^~ /.well-known { 105 | # The rules in this block are an adaptation of the rules 106 | # in `.htaccess` that concern `/.well-known`. 107 | 108 | location = /.well-known/carddav { return 301 /remote.php/dav/; } 109 | location = /.well-known/caldav { return 301 /remote.php/dav/; } 110 | 111 | location /.well-known/acme-challenge { try_files $uri $uri/ =404; } 112 | location /.well-known/pki-validation { try_files $uri $uri/ =404; } 113 | 114 | # Let Nextcloud's API for `/.well-known` URIs handle all other 115 | # requests by passing them to the front-end controller. 116 | return 301 /index.php$request_uri; 117 | } 118 | 119 | # Rules borrowed from `.htaccess` to hide certain paths from clients 120 | location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } 121 | location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } 122 | 123 | # Ensure this block, which passes PHP files to the PHP process, is above the blocks 124 | # which handle static assets (as seen below). If this block is not declared first, 125 | # then Nginx will encounter an infinite rewriting loop when it prepends `/index.php` 126 | # to the URI, resulting in a HTTP 500 error response. 127 | location ~ \.php(?:$|/) { 128 | # Required for legacy support 129 | rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri; 130 | 131 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; 132 | set $path_info $fastcgi_path_info; 133 | 134 | try_files $fastcgi_script_name =404; 135 | 136 | include fastcgi_params; 137 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 138 | fastcgi_param PATH_INFO $path_info; 139 | #fastcgi_param HTTPS on; 140 | 141 | fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice 142 | fastcgi_param front_controller_active true; # Enable pretty urls 143 | fastcgi_pass php-handler; 144 | 145 | fastcgi_intercept_errors on; 146 | fastcgi_request_buffering off; 147 | } 148 | 149 | location ~ \.(?:css|js|svg|gif)$ { 150 | try_files $uri /index.php$request_uri; 151 | expires 6M; # Cache-Control policy borrowed from `.htaccess` 152 | access_log off; # Optional: Don't log access to assets 153 | } 154 | 155 | location ~ \.woff2?$ { 156 | try_files $uri /index.php$request_uri; 157 | expires 7d; # Cache-Control policy borrowed from `.htaccess` 158 | access_log off; # Optional: Don't log access to assets 159 | } 160 | 161 | # Rule borrowed from `.htaccess` 162 | location /remote { 163 | return 301 /remote.php$request_uri; 164 | } 165 | 166 | location / { 167 | try_files $uri $uri/ /index.php$request_uri; 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/postgres/apache/db.env: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD= 2 | POSTGRES_DB=nextcloud 3 | POSTGRES_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/postgres/apache/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: postgres:alpine 6 | restart: always 7 | volumes: 8 | - db:/var/lib/postgresql/data 9 | env_file: 10 | - db.env 11 | 12 | redis: 13 | image: redis:alpine 14 | restart: always 15 | 16 | app: 17 | image: nextcloud:apache 18 | restart: always 19 | ports: 20 | - 127.0.0.1:8080:80 21 | volumes: 22 | - nextcloud:/var/www/html 23 | environment: 24 | - POSTGRES_HOST=db 25 | - REDIS_HOST=redis 26 | env_file: 27 | - db.env 28 | depends_on: 29 | - db 30 | - redis 31 | 32 | cron: 33 | image: nextcloud:apache 34 | restart: always 35 | volumes: 36 | - nextcloud:/var/www/html 37 | entrypoint: /cron.sh 38 | depends_on: 39 | - db 40 | - redis 41 | 42 | volumes: 43 | db: 44 | nextcloud: 45 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/postgres/fpm/db.env: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD= 2 | POSTGRES_DB=nextcloud 3 | POSTGRES_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/postgres/fpm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: postgres:alpine 6 | restart: always 7 | volumes: 8 | - db:/var/lib/postgresql/data 9 | env_file: 10 | - db.env 11 | 12 | redis: 13 | image: redis:alpine 14 | restart: always 15 | 16 | app: 17 | image: nextcloud:fpm-alpine 18 | restart: always 19 | volumes: 20 | - nextcloud:/var/www/html 21 | environment: 22 | - POSTGRES_HOST=db 23 | - REDIS_HOST=redis 24 | env_file: 25 | - db.env 26 | depends_on: 27 | - db 28 | - redis 29 | 30 | web: 31 | build: ./web 32 | restart: always 33 | ports: 34 | - 127.0.0.1:8080:80 35 | volumes: 36 | - nextcloud:/var/www/html:ro 37 | depends_on: 38 | - app 39 | 40 | cron: 41 | image: nextcloud:fpm-alpine 42 | restart: always 43 | volumes: 44 | - nextcloud:/var/www/html 45 | entrypoint: /cron.sh 46 | depends_on: 47 | - db 48 | - redis 49 | 50 | volumes: 51 | db: 52 | nextcloud: 53 | -------------------------------------------------------------------------------- /.examples/docker-compose/insecure/postgres/fpm/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/apache/db.env: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD= 2 | MYSQL_DATABASE=nextcloud 3 | MYSQL_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: mariadb:10.5 6 | command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW 7 | restart: always 8 | volumes: 9 | - db:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD= 12 | env_file: 13 | - db.env 14 | 15 | redis: 16 | image: redis:alpine 17 | restart: always 18 | 19 | app: 20 | image: nextcloud:apache 21 | restart: always 22 | volumes: 23 | - nextcloud:/var/www/html 24 | environment: 25 | - VIRTUAL_HOST= 26 | - LETSENCRYPT_HOST= 27 | - LETSENCRYPT_EMAIL= 28 | - MYSQL_HOST=db 29 | - REDIS_HOST=redis 30 | env_file: 31 | - db.env 32 | depends_on: 33 | - db 34 | - redis 35 | networks: 36 | - proxy-tier 37 | - default 38 | 39 | cron: 40 | image: nextcloud:apache 41 | restart: always 42 | volumes: 43 | - nextcloud:/var/www/html 44 | entrypoint: /cron.sh 45 | depends_on: 46 | - db 47 | - redis 48 | 49 | proxy: 50 | build: ./proxy 51 | restart: always 52 | ports: 53 | - 80:80 54 | - 443:443 55 | labels: 56 | com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" 57 | volumes: 58 | - certs:/etc/nginx/certs:ro 59 | - vhost.d:/etc/nginx/vhost.d 60 | - html:/usr/share/nginx/html 61 | - /var/run/docker.sock:/tmp/docker.sock:ro 62 | networks: 63 | - proxy-tier 64 | 65 | letsencrypt-companion: 66 | image: nginxproxy/acme-companion 67 | restart: always 68 | volumes: 69 | - certs:/etc/nginx/certs 70 | - acme:/etc/acme.sh 71 | - vhost.d:/etc/nginx/vhost.d 72 | - html:/usr/share/nginx/html 73 | - /var/run/docker.sock:/var/run/docker.sock:ro 74 | networks: 75 | - proxy-tier 76 | depends_on: 77 | - proxy 78 | 79 | # self signed 80 | # omgwtfssl: 81 | # image: paulczar/omgwtfssl 82 | # restart: "no" 83 | # volumes: 84 | # - certs:/certs 85 | # environment: 86 | # - SSL_SUBJECT=servhostname.local 87 | # - CA_SUBJECT=my@example.com 88 | # - SSL_KEY=/certs/servhostname.local.key 89 | # - SSL_CSR=/certs/servhostname.local.csr 90 | # - SSL_CERT=/certs/servhostname.local.crt 91 | # networks: 92 | # - proxy-tier 93 | 94 | volumes: 95 | db: 96 | nextcloud: 97 | certs: 98 | acme: 99 | vhost.d: 100 | html: 101 | 102 | networks: 103 | proxy-tier: 104 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/apache/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginxproxy/nginx-proxy:alpine 2 | 3 | COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/apache/proxy/uploadsize.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 10G; 2 | proxy_request_buffering off; 3 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/fpm/db.env: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD= 2 | MYSQL_DATABASE=nextcloud 3 | MYSQL_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: mariadb:10.5 6 | command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW 7 | restart: always 8 | volumes: 9 | - db:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD= 12 | env_file: 13 | - db.env 14 | 15 | redis: 16 | image: redis:alpine 17 | restart: always 18 | 19 | app: 20 | image: nextcloud:fpm-alpine 21 | restart: always 22 | volumes: 23 | - nextcloud:/var/www/html 24 | environment: 25 | - MYSQL_HOST=db 26 | - REDIS_HOST=redis 27 | env_file: 28 | - db.env 29 | depends_on: 30 | - db 31 | - redis 32 | 33 | web: 34 | build: ./web 35 | restart: always 36 | volumes: 37 | - nextcloud:/var/www/html:ro 38 | environment: 39 | - VIRTUAL_HOST= 40 | - LETSENCRYPT_HOST= 41 | - LETSENCRYPT_EMAIL= 42 | depends_on: 43 | - app 44 | networks: 45 | - proxy-tier 46 | - default 47 | 48 | cron: 49 | image: nextcloud:fpm-alpine 50 | restart: always 51 | volumes: 52 | - nextcloud:/var/www/html 53 | entrypoint: /cron.sh 54 | depends_on: 55 | - db 56 | - redis 57 | 58 | proxy: 59 | build: ./proxy 60 | restart: always 61 | ports: 62 | - 80:80 63 | - 443:443 64 | labels: 65 | com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" 66 | volumes: 67 | - certs:/etc/nginx/certs:ro 68 | - vhost.d:/etc/nginx/vhost.d 69 | - html:/usr/share/nginx/html 70 | - /var/run/docker.sock:/tmp/docker.sock:ro 71 | networks: 72 | - proxy-tier 73 | 74 | letsencrypt-companion: 75 | image: nginxproxy/acme-companion 76 | restart: always 77 | volumes: 78 | - certs:/etc/nginx/certs 79 | - acme:/etc/acme.sh 80 | - vhost.d:/etc/nginx/vhost.d 81 | - html:/usr/share/nginx/html 82 | - /var/run/docker.sock:/var/run/docker.sock:ro 83 | networks: 84 | - proxy-tier 85 | depends_on: 86 | - proxy 87 | 88 | # self signed 89 | # omgwtfssl: 90 | # image: paulczar/omgwtfssl 91 | # restart: "no" 92 | # volumes: 93 | # - certs:/certs 94 | # environment: 95 | # - SSL_SUBJECT=servhostname.local 96 | # - CA_SUBJECT=my@example.com 97 | # - SSL_KEY=/certs/servhostname.local.key 98 | # - SSL_CSR=/certs/servhostname.local.csr 99 | # - SSL_CERT=/certs/servhostname.local.crt 100 | # networks: 101 | # - proxy-tier 102 | 103 | volumes: 104 | db: 105 | nextcloud: 106 | certs: 107 | acme: 108 | vhost.d: 109 | html: 110 | 111 | networks: 112 | proxy-tier: 113 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/fpm/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginxproxy/nginx-proxy:alpine 2 | 3 | COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/fpm/proxy/uploadsize.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 10G; 2 | proxy_request_buffering off; 3 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/apache/db.env: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD= 2 | POSTGRES_DB=nextcloud 3 | POSTGRES_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/apache/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: postgres:alpine 6 | restart: always 7 | volumes: 8 | - db:/var/lib/postgresql/data 9 | env_file: 10 | - db.env 11 | 12 | redis: 13 | image: redis:alpine 14 | restart: always 15 | 16 | app: 17 | image: nextcloud:apache 18 | restart: always 19 | volumes: 20 | - nextcloud:/var/www/html 21 | environment: 22 | - VIRTUAL_HOST= 23 | - LETSENCRYPT_HOST= 24 | - LETSENCRYPT_EMAIL= 25 | - POSTGRES_HOST=db 26 | - REDIS_HOST=redis 27 | env_file: 28 | - db.env 29 | depends_on: 30 | - db 31 | - redis 32 | networks: 33 | - proxy-tier 34 | - default 35 | 36 | cron: 37 | image: nextcloud:apache 38 | restart: always 39 | volumes: 40 | - nextcloud:/var/www/html 41 | entrypoint: /cron.sh 42 | depends_on: 43 | - db 44 | - redis 45 | 46 | proxy: 47 | build: ./proxy 48 | restart: always 49 | ports: 50 | - 80:80 51 | - 443:443 52 | labels: 53 | com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" 54 | volumes: 55 | - certs:/etc/nginx/certs:ro 56 | - vhost.d:/etc/nginx/vhost.d 57 | - html:/usr/share/nginx/html 58 | - /var/run/docker.sock:/tmp/docker.sock:ro 59 | networks: 60 | - proxy-tier 61 | 62 | letsencrypt-companion: 63 | image: nginxproxy/acme-companion 64 | restart: always 65 | volumes: 66 | - certs:/etc/nginx/certs 67 | - acme:/etc/acme.sh 68 | - vhost.d:/etc/nginx/vhost.d 69 | - html:/usr/share/nginx/html 70 | - /var/run/docker.sock:/var/run/docker.sock:ro 71 | networks: 72 | - proxy-tier 73 | depends_on: 74 | - proxy 75 | 76 | # self signed 77 | # omgwtfssl: 78 | # image: paulczar/omgwtfssl 79 | # restart: "no" 80 | # volumes: 81 | # - certs:/certs 82 | # environment: 83 | # - SSL_SUBJECT=servhostname.local 84 | # - CA_SUBJECT=my@example.com 85 | # - SSL_KEY=/certs/servhostname.local.key 86 | # - SSL_CSR=/certs/servhostname.local.csr 87 | # - SSL_CERT=/certs/servhostname.local.crt 88 | # networks: 89 | # - proxy-tier 90 | 91 | volumes: 92 | db: 93 | nextcloud: 94 | certs: 95 | acme: 96 | vhost.d: 97 | html: 98 | 99 | networks: 100 | proxy-tier: 101 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/apache/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginxproxy/nginx-proxy:alpine 2 | 3 | COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/apache/proxy/uploadsize.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 10G; 2 | proxy_request_buffering off; 3 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/fpm/db.env: -------------------------------------------------------------------------------- 1 | POSTGRES_PASSWORD= 2 | POSTGRES_DB=nextcloud 3 | POSTGRES_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/fpm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: postgres:alpine 6 | restart: always 7 | volumes: 8 | - db:/var/lib/postgresql/data 9 | env_file: 10 | - db.env 11 | 12 | redis: 13 | image: redis:alpine 14 | restart: always 15 | 16 | app: 17 | image: nextcloud:fpm-alpine 18 | restart: always 19 | volumes: 20 | - nextcloud:/var/www/html 21 | environment: 22 | - POSTGRES_HOST=db 23 | - REDIS_HOST=redis 24 | env_file: 25 | - db.env 26 | depends_on: 27 | - db 28 | - redis 29 | 30 | web: 31 | build: ./web 32 | restart: always 33 | volumes: 34 | - nextcloud:/var/www/html:ro 35 | environment: 36 | - VIRTUAL_HOST= 37 | - LETSENCRYPT_HOST= 38 | - LETSENCRYPT_EMAIL= 39 | depends_on: 40 | - app 41 | networks: 42 | - proxy-tier 43 | - default 44 | 45 | cron: 46 | image: nextcloud:fpm-alpine 47 | restart: always 48 | volumes: 49 | - nextcloud:/var/www/html 50 | entrypoint: /cron.sh 51 | depends_on: 52 | - db 53 | - redis 54 | 55 | proxy: 56 | build: ./proxy 57 | restart: always 58 | ports: 59 | - 80:80 60 | - 443:443 61 | labels: 62 | com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" 63 | volumes: 64 | - certs:/etc/nginx/certs:ro 65 | - vhost.d:/etc/nginx/vhost.d 66 | - html:/usr/share/nginx/html 67 | - /var/run/docker.sock:/tmp/docker.sock:ro 68 | networks: 69 | - proxy-tier 70 | 71 | letsencrypt-companion: 72 | image: nginxproxy/acme-companion 73 | restart: always 74 | volumes: 75 | - certs:/etc/nginx/certs 76 | - acme:/etc/acme.sh 77 | - vhost.d:/etc/nginx/vhost.d 78 | - html:/usr/share/nginx/html 79 | - /var/run/docker.sock:/var/run/docker.sock:ro 80 | networks: 81 | - proxy-tier 82 | depends_on: 83 | - proxy 84 | 85 | # self signed 86 | # omgwtfssl: 87 | # image: paulczar/omgwtfssl 88 | # restart: "no" 89 | # volumes: 90 | # - certs:/certs 91 | # environment: 92 | # - SSL_SUBJECT=servhostname.local 93 | # - CA_SUBJECT=my@example.com 94 | # - SSL_KEY=/certs/servhostname.local.key 95 | # - SSL_CSR=/certs/servhostname.local.csr 96 | # - SSL_CERT=/certs/servhostname.local.crt 97 | # networks: 98 | # - proxy-tier 99 | 100 | volumes: 101 | db: 102 | nextcloud: 103 | certs: 104 | acme: 105 | vhost.d: 106 | html: 107 | 108 | networks: 109 | proxy-tier: 110 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/fpm/proxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginxproxy/nginx-proxy:alpine 2 | 3 | COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf 4 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/fpm/proxy/uploadsize.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 10G; 2 | proxy_request_buffering off; 3 | -------------------------------------------------------------------------------- /.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:apache 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | supervisor \ 5 | && rm -rf /var/lib/apt/lists/* \ 6 | && mkdir /var/log/supervisord /var/run/supervisord 7 | 8 | COPY supervisord.conf / 9 | 10 | ENV NEXTCLOUD_UPDATE=1 11 | 12 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 13 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/apache/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:apache2] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=apache2-foreground 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm-alpine 2 | 3 | RUN apk add --no-cache supervisor \ 4 | && mkdir /var/log/supervisord /var/run/supervisord 5 | 6 | COPY supervisord.conf / 7 | 8 | ENV NEXTCLOUD_UPDATE=1 9 | 10 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 11 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/fpm-alpine/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:php-fpm] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=php-fpm 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | supervisor \ 5 | && rm -rf /var/lib/apt/lists/* \ 6 | && mkdir /var/log/supervisord /var/run/supervisord 7 | 8 | COPY supervisord.conf / 9 | 10 | ENV NEXTCLOUD_UPDATE=1 11 | 12 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 13 | -------------------------------------------------------------------------------- /.examples/dockerfiles/cron/fpm/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:php-fpm] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=php-fpm 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:apache 2 | 3 | RUN set -ex; \ 4 | \ 5 | apt-get update; \ 6 | apt-get install -y --no-install-recommends \ 7 | ffmpeg \ 8 | libmagickcore-6.q16-6-extra \ 9 | procps \ 10 | smbclient \ 11 | supervisor \ 12 | # libreoffice \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | RUN set -ex; \ 17 | \ 18 | savedAptMark="$(apt-mark showmanual)"; \ 19 | \ 20 | apt-get update; \ 21 | apt-get install -y --no-install-recommends \ 22 | libbz2-dev \ 23 | libc-client-dev \ 24 | libkrb5-dev \ 25 | libsmbclient-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 29 | docker-php-ext-install \ 30 | bz2 \ 31 | imap \ 32 | ; \ 33 | pecl install smbclient; \ 34 | docker-php-ext-enable smbclient; \ 35 | \ 36 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 37 | apt-mark auto '.*' > /dev/null; \ 38 | apt-mark manual $savedAptMark; \ 39 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 40 | | awk '/=>/ { print $3 }' \ 41 | | sort -u \ 42 | | xargs -r dpkg-query -S \ 43 | | cut -d: -f1 \ 44 | | sort -u \ 45 | | xargs -rt apt-mark manual; \ 46 | \ 47 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 48 | rm -rf /var/lib/apt/lists/* 49 | 50 | RUN mkdir -p \ 51 | /var/log/supervisord \ 52 | /var/run/supervisord \ 53 | ; 54 | 55 | COPY supervisord.conf / 56 | 57 | ENV NEXTCLOUD_UPDATE=1 58 | 59 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 60 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/apache/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:apache2] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=apache2-foreground 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm-alpine 2 | 3 | RUN set -ex; \ 4 | \ 5 | apk add --no-cache \ 6 | ffmpeg \ 7 | imagemagick \ 8 | procps \ 9 | samba-client \ 10 | supervisor \ 11 | # libreoffice \ 12 | ; 13 | 14 | RUN set -ex; \ 15 | \ 16 | apk add --no-cache --virtual .build-deps \ 17 | $PHPIZE_DEPS \ 18 | imap-dev \ 19 | krb5-dev \ 20 | openssl-dev \ 21 | samba-dev \ 22 | bzip2-dev \ 23 | ; \ 24 | \ 25 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 26 | docker-php-ext-install \ 27 | bz2 \ 28 | imap \ 29 | ; \ 30 | pecl install smbclient; \ 31 | docker-php-ext-enable smbclient; \ 32 | \ 33 | runDeps="$( \ 34 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 35 | | tr ',' '\n' \ 36 | | sort -u \ 37 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 38 | )"; \ 39 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 40 | apk del .build-deps 41 | 42 | RUN mkdir -p \ 43 | /var/log/supervisord \ 44 | /var/run/supervisord \ 45 | ; 46 | 47 | COPY supervisord.conf / 48 | 49 | ENV NEXTCLOUD_UPDATE=1 50 | 51 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 52 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/fpm-alpine/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:php-fpm] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=php-fpm 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm 2 | 3 | RUN set -ex; \ 4 | \ 5 | apt-get update; \ 6 | apt-get install -y --no-install-recommends \ 7 | ffmpeg \ 8 | libmagickcore-6.q16-6-extra \ 9 | procps \ 10 | smbclient \ 11 | supervisor \ 12 | # libreoffice \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | RUN set -ex; \ 17 | \ 18 | savedAptMark="$(apt-mark showmanual)"; \ 19 | \ 20 | apt-get update; \ 21 | apt-get install -y --no-install-recommends \ 22 | libbz2-dev \ 23 | libc-client-dev \ 24 | libkrb5-dev \ 25 | libsmbclient-dev \ 26 | ; \ 27 | \ 28 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 29 | docker-php-ext-install \ 30 | bz2 \ 31 | imap \ 32 | ; \ 33 | pecl install smbclient; \ 34 | docker-php-ext-enable smbclient; \ 35 | \ 36 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 37 | apt-mark auto '.*' > /dev/null; \ 38 | apt-mark manual $savedAptMark; \ 39 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 40 | | awk '/=>/ { print $3 }' \ 41 | | sort -u \ 42 | | xargs -r dpkg-query -S \ 43 | | cut -d: -f1 \ 44 | | sort -u \ 45 | | xargs -rt apt-mark manual; \ 46 | \ 47 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 48 | rm -rf /var/lib/apt/lists/* 49 | 50 | RUN mkdir -p \ 51 | /var/log/supervisord \ 52 | /var/run/supervisord \ 53 | ; 54 | 55 | COPY supervisord.conf / 56 | 57 | ENV NEXTCLOUD_UPDATE=1 58 | 59 | CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"] 60 | -------------------------------------------------------------------------------- /.examples/dockerfiles/full/fpm/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | logfile=/var/log/supervisord/supervisord.log 4 | pidfile=/var/run/supervisord/supervisord.pid 5 | childlogdir=/var/log/supervisord/ 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=error 9 | 10 | [program:php-fpm] 11 | stdout_logfile=/dev/stdout 12 | stdout_logfile_maxbytes=0 13 | stderr_logfile=/dev/stderr 14 | stderr_logfile_maxbytes=0 15 | command=php-fpm 16 | 17 | [program:cron] 18 | stdout_logfile=/dev/stdout 19 | stdout_logfile_maxbytes=0 20 | stderr_logfile=/dev/stderr 21 | stderr_logfile_maxbytes=0 22 | command=/cron.sh 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/imap/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:apache 2 | 3 | RUN set -ex; \ 4 | \ 5 | savedAptMark="$(apt-mark showmanual)"; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | libc-client-dev \ 10 | libkrb5-dev \ 11 | ; \ 12 | \ 13 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 14 | docker-php-ext-install imap; \ 15 | \ 16 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 17 | apt-mark auto '.*' > /dev/null; \ 18 | apt-mark manual $savedAptMark; \ 19 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 20 | | awk '/=>/ { print $3 }' \ 21 | | sort -u \ 22 | | xargs -r dpkg-query -S \ 23 | | cut -d: -f1 \ 24 | | sort -u \ 25 | | xargs -rt apt-mark manual; \ 26 | \ 27 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 28 | rm -rf /var/lib/apt/lists/* 29 | -------------------------------------------------------------------------------- /.examples/dockerfiles/imap/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm-alpine 2 | 3 | RUN set -ex; \ 4 | \ 5 | apk add --no-cache --virtual .build-deps \ 6 | $PHPIZE_DEPS \ 7 | imap-dev \ 8 | krb5-dev \ 9 | openssl-dev \ 10 | ; \ 11 | \ 12 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 13 | docker-php-ext-install imap; \ 14 | \ 15 | runDeps="$( \ 16 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 17 | | tr ',' '\n' \ 18 | | sort -u \ 19 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 20 | )"; \ 21 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 22 | apk del .build-deps 23 | -------------------------------------------------------------------------------- /.examples/dockerfiles/imap/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm 2 | 3 | RUN set -ex; \ 4 | \ 5 | savedAptMark="$(apt-mark showmanual)"; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | libc-client-dev \ 10 | libkrb5-dev \ 11 | ; \ 12 | \ 13 | docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ 14 | docker-php-ext-install imap; \ 15 | \ 16 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 17 | apt-mark auto '.*' > /dev/null; \ 18 | apt-mark manual $savedAptMark; \ 19 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 20 | | awk '/=>/ { print $3 }' \ 21 | | sort -u \ 22 | | xargs -r dpkg-query -S \ 23 | | cut -d: -f1 \ 24 | | sort -u \ 25 | | xargs -rt apt-mark manual; \ 26 | \ 27 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 28 | rm -rf /var/lib/apt/lists/* 29 | -------------------------------------------------------------------------------- /.examples/dockerfiles/smb/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:apache 2 | 3 | RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/* 4 | -------------------------------------------------------------------------------- /.examples/dockerfiles/smb/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm-alpine 2 | 3 | RUN apk add --no-cache procps samba-client 4 | -------------------------------------------------------------------------------- /.examples/dockerfiles/smb/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nextcloud:fpm 2 | 3 | RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/* 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Image_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐛 Image issue 3 | about: Issues related to the Nextcloud Docker image 4 | --- 5 | 6 | 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: 🐛 Nextcloud issue 3 | url: https://github.com/nextcloud/server/issues/new/choose 4 | about: Bug reports and feature requests for Nextcloud 5 | - name: 🐳 Docker Support and Help 6 | url: https://forums.docker.com/ 7 | about: Configuration, installation, networking and other questions 8 | - name: ❓ Nextcloud Support and Help 9 | url: https://help.nextcloud.com/ 10 | about: Configuration, webserver/proxy or performance issues and other questions 11 | -------------------------------------------------------------------------------- /.github/workflows/images.yml: -------------------------------------------------------------------------------- 1 | name: Images 2 | 3 | on: 4 | pull_request: 5 | workflow_run: 6 | workflows: ["update.sh"] 7 | branches: [master] 8 | types: 9 | - completed 10 | 11 | defaults: 12 | run: 13 | shell: 'bash -Eeuo pipefail -x {0}' 14 | 15 | jobs: 16 | 17 | generate-jobs: 18 | name: Generate Jobs 19 | runs-on: ubuntu-latest 20 | outputs: 21 | strategy: ${{ steps.generate-jobs.outputs.strategy }} 22 | steps: 23 | - uses: actions/checkout@v2 24 | - id: generate-jobs 25 | name: Generate Jobs 26 | run: | 27 | git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew 28 | strategy="$(GITHUB_REPOSITORY=nextcloud ~/bashbrew/scripts/github-actions/generate.sh)" 29 | strategy="$(~/bashbrew/scripts/github-actions/munge-i386.sh -c <<<"$strategy")" 30 | jq . <<<"$strategy" # sanity check / debugging aid 31 | echo "::set-output name=strategy::$strategy" 32 | 33 | test: 34 | needs: generate-jobs 35 | strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} 36 | name: ${{ matrix.name }} 37 | runs-on: ${{ matrix.os }} 38 | steps: 39 | - uses: actions/checkout@v2 40 | - name: Prepare Environment 41 | run: ${{ matrix.runs.prepare }} 42 | - name: Run update.sh script 43 | run: ./update.sh 44 | - name: Pull Dependencies 45 | run: ${{ matrix.runs.pull }} 46 | - name: Build ${{ matrix.name }} 47 | run: ${{ matrix.runs.build }} 48 | - name: History ${{ matrix.name }} 49 | run: ${{ matrix.runs.history }} 50 | - name: Test ${{ matrix.name }} 51 | run: ${{ matrix.runs.test }} 52 | - name: '"docker images"' 53 | run: ${{ matrix.runs.images }} 54 | -------------------------------------------------------------------------------- /.github/workflows/update-sh.yml: -------------------------------------------------------------------------------- 1 | name: update.sh 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | schedule: 8 | - cron: '15 0 * * *' 9 | 10 | jobs: 11 | run_update_sh: 12 | name: Run update.sh script 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Run update.sh script 17 | run: ./update.sh 18 | - name: Commit files 19 | run: | 20 | git config --local user.email "workflow@github.com" 21 | git config --local user.name "GitHub Workflow" 22 | git add -A 23 | git commit -m "Runs update.sh" || echo "Nothing to update" 24 | - name: Push changes 25 | uses: ad-m/github-push-action@master 26 | with: 27 | github_token: ${{ secrets.GITHUB_TOKEN }} 28 | force: true 29 | -------------------------------------------------------------------------------- /.travis/test-example-dockerfiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | image="$1" 5 | 6 | cd .examples/dockerfiles 7 | 8 | dirs=( */ ) 9 | dirs=( "${dirs[@]%/}" ) 10 | for dir in "${dirs[@]}"; do 11 | if [ -d "$dir/$VARIANT" ]; then 12 | ( 13 | cd "$dir/$VARIANT" 14 | sed -ri -e 's/^FROM .*/FROM '"$image"'/g' 'Dockerfile' 15 | docker build -t "$image-$dir" . 16 | ) 17 | fi 18 | done 19 | -------------------------------------------------------------------------------- /21/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template 2 | FROM php:7.4-apache-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | RUN a2enmod headers rewrite remoteip ;\ 117 | {\ 118 | echo RemoteIPHeader X-Real-IP ;\ 119 | echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ 120 | echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ 121 | echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ 122 | } > /etc/apache2/conf-available/remoteip.conf;\ 123 | a2enconf remoteip 124 | 125 | ENV NEXTCLOUD_VERSION 21.0.9 126 | 127 | RUN set -ex; \ 128 | fetchDeps=" \ 129 | gnupg \ 130 | dirmngr \ 131 | "; \ 132 | apt-get update; \ 133 | apt-get install -y --no-install-recommends $fetchDeps; \ 134 | \ 135 | curl -fsSL -o nextcloud.tar.bz2 \ 136 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 137 | curl -fsSL -o nextcloud.tar.bz2.asc \ 138 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 139 | export GNUPGHOME="$(mktemp -d)"; \ 140 | # gpg key from https://nextcloud.com/nextcloud.asc 141 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 142 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 143 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 144 | gpgconf --kill all; \ 145 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 146 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 147 | mkdir -p /usr/src/nextcloud/data; \ 148 | mkdir -p /usr/src/nextcloud/custom_apps; \ 149 | chmod +x /usr/src/nextcloud/occ; \ 150 | \ 151 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 152 | rm -rf /var/lib/apt/lists/* 153 | 154 | COPY *.sh upgrade.exclude / 155 | COPY config/* /usr/src/nextcloud/config/ 156 | 157 | ENTRYPOINT ["/entrypoint.sh"] 158 | CMD ["apache2-foreground"] 159 | #very important.... 160 | -------------------------------------------------------------------------------- /21/apache/config/apache-pretty-urls.config.php: -------------------------------------------------------------------------------- 1 | '/', 4 | ); 5 | -------------------------------------------------------------------------------- /21/apache/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /21/apache/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /21/apache/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /21/apache/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /21/apache/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /21/apache/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /21/apache/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | 6 | # very important .... 7 | -------------------------------------------------------------------------------- /21/apache/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /21/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template 2 | FROM php:7.4-fpm-alpine3.15 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apk add --no-cache \ 8 | rsync \ 9 | ; \ 10 | \ 11 | rm /var/spool/cron/crontabs/root; \ 12 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 13 | 14 | # install the PHP extensions we need 15 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 16 | RUN set -ex; \ 17 | \ 18 | apk add --no-cache --virtual .build-deps \ 19 | $PHPIZE_DEPS \ 20 | autoconf \ 21 | freetype-dev \ 22 | icu-dev \ 23 | libevent-dev \ 24 | libjpeg-turbo-dev \ 25 | libmcrypt-dev \ 26 | libpng-dev \ 27 | libmemcached-dev \ 28 | libxml2-dev \ 29 | libzip-dev \ 30 | openldap-dev \ 31 | pcre-dev \ 32 | postgresql-dev \ 33 | imagemagick-dev \ 34 | libwebp-dev \ 35 | gmp-dev \ 36 | ; \ 37 | \ 38 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 39 | docker-php-ext-configure ldap; \ 40 | docker-php-ext-install -j "$(nproc)" \ 41 | bcmath \ 42 | exif \ 43 | gd \ 44 | intl \ 45 | ldap \ 46 | opcache \ 47 | pcntl \ 48 | pdo_mysql \ 49 | pdo_pgsql \ 50 | zip \ 51 | gmp \ 52 | ; \ 53 | \ 54 | # pecl will claim success even if one install fails, so we need to perform each install separately 55 | pecl install APCu-5.1.21; \ 56 | pecl install memcached-3.2.0RC1; \ 57 | pecl install redis-5.3.7; \ 58 | pecl install imagick-3.7.0; \ 59 | \ 60 | docker-php-ext-enable \ 61 | apcu \ 62 | memcached \ 63 | redis \ 64 | imagick \ 65 | ; \ 66 | rm -r /tmp/pear; \ 67 | \ 68 | runDeps="$( \ 69 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 70 | | tr ',' '\n' \ 71 | | sort -u \ 72 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 73 | )"; \ 74 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 75 | apk del .build-deps 76 | 77 | # set recommended PHP.ini settings 78 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 79 | ENV PHP_MEMORY_LIMIT 512M 80 | ENV PHP_UPLOAD_LIMIT 512M 81 | RUN { \ 82 | echo 'opcache.enable=1'; \ 83 | echo 'opcache.interned_strings_buffer=8'; \ 84 | echo 'opcache.max_accelerated_files=10000'; \ 85 | echo 'opcache.memory_consumption=128'; \ 86 | echo 'opcache.save_comments=1'; \ 87 | echo 'opcache.revalidate_freq=1'; \ 88 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 89 | \ 90 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 91 | \ 92 | { \ 93 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 94 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 95 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 96 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 97 | \ 98 | mkdir /var/www/data; \ 99 | chown -R www-data:root /var/www; \ 100 | chmod -R g=u /var/www 101 | 102 | VOLUME /var/www/html 103 | 104 | 105 | ENV NEXTCLOUD_VERSION 21.0.9 106 | 107 | RUN set -ex; \ 108 | apk add --no-cache --virtual .fetch-deps \ 109 | bzip2 \ 110 | gnupg \ 111 | ; \ 112 | \ 113 | curl -fsSL -o nextcloud.tar.bz2 \ 114 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 115 | curl -fsSL -o nextcloud.tar.bz2.asc \ 116 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 117 | export GNUPGHOME="$(mktemp -d)"; \ 118 | # gpg key from https://nextcloud.com/nextcloud.asc 119 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 120 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 121 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 122 | gpgconf --kill all; \ 123 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 124 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 125 | mkdir -p /usr/src/nextcloud/data; \ 126 | mkdir -p /usr/src/nextcloud/custom_apps; \ 127 | chmod +x /usr/src/nextcloud/occ; \ 128 | apk del .fetch-deps 129 | 130 | COPY *.sh upgrade.exclude / 131 | COPY config/* /usr/src/nextcloud/config/ 132 | 133 | ENTRYPOINT ["/entrypoint.sh"] 134 | CMD ["php-fpm"] 135 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /21/fpm-alpine/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /21/fpm-alpine/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /21/fpm-alpine/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /21/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template 2 | FROM php:7.4-fpm-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | 117 | ENV NEXTCLOUD_VERSION 21.0.9 118 | 119 | RUN set -ex; \ 120 | fetchDeps=" \ 121 | gnupg \ 122 | dirmngr \ 123 | "; \ 124 | apt-get update; \ 125 | apt-get install -y --no-install-recommends $fetchDeps; \ 126 | \ 127 | curl -fsSL -o nextcloud.tar.bz2 \ 128 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 129 | curl -fsSL -o nextcloud.tar.bz2.asc \ 130 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 131 | export GNUPGHOME="$(mktemp -d)"; \ 132 | # gpg key from https://nextcloud.com/nextcloud.asc 133 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 134 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 135 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 136 | gpgconf --kill all; \ 137 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 138 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 139 | mkdir -p /usr/src/nextcloud/data; \ 140 | mkdir -p /usr/src/nextcloud/custom_apps; \ 141 | chmod +x /usr/src/nextcloud/occ; \ 142 | \ 143 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 144 | rm -rf /var/lib/apt/lists/* 145 | 146 | COPY *.sh upgrade.exclude / 147 | COPY config/* /usr/src/nextcloud/config/ 148 | 149 | ENTRYPOINT ["/entrypoint.sh"] 150 | CMD ["php-fpm"] 151 | -------------------------------------------------------------------------------- /21/fpm/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /21/fpm/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /21/fpm/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /21/fpm/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /21/fpm/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /21/fpm/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /21/fpm/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | # important.. 6 | -------------------------------------------------------------------------------- /21/fpm/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /22/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template 2 | FROM php:8.0-apache-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | RUN a2enmod headers rewrite remoteip ;\ 117 | {\ 118 | echo RemoteIPHeader X-Real-IP ;\ 119 | echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ 120 | echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ 121 | echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ 122 | } > /etc/apache2/conf-available/remoteip.conf;\ 123 | a2enconf remoteip 124 | 125 | ENV NEXTCLOUD_VERSION 22.2.5 126 | 127 | RUN set -ex; \ 128 | fetchDeps=" \ 129 | gnupg \ 130 | dirmngr \ 131 | "; \ 132 | apt-get update; \ 133 | apt-get install -y --no-install-recommends $fetchDeps; \ 134 | \ 135 | curl -fsSL -o nextcloud.tar.bz2 \ 136 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 137 | curl -fsSL -o nextcloud.tar.bz2.asc \ 138 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 139 | export GNUPGHOME="$(mktemp -d)"; \ 140 | # gpg key from https://nextcloud.com/nextcloud.asc 141 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 142 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 143 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 144 | gpgconf --kill all; \ 145 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 146 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 147 | mkdir -p /usr/src/nextcloud/data; \ 148 | mkdir -p /usr/src/nextcloud/custom_apps; \ 149 | chmod +x /usr/src/nextcloud/occ; \ 150 | \ 151 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 152 | rm -rf /var/lib/apt/lists/* 153 | 154 | COPY *.sh upgrade.exclude / 155 | COPY config/* /usr/src/nextcloud/config/ 156 | 157 | ENTRYPOINT ["/entrypoint.sh"] 158 | CMD ["apache2-foreground"] 159 | -------------------------------------------------------------------------------- /22/apache/config/apache-pretty-urls.config.php: -------------------------------------------------------------------------------- 1 | '/', 4 | ); 5 | -------------------------------------------------------------------------------- /22/apache/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /22/apache/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /22/apache/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /22/apache/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /22/apache/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /22/apache/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /22/apache/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /22/apache/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /22/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template 2 | FROM php:8.0-fpm-alpine3.15 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apk add --no-cache \ 8 | rsync \ 9 | ; \ 10 | \ 11 | rm /var/spool/cron/crontabs/root; \ 12 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 13 | 14 | # install the PHP extensions we need 15 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 16 | RUN set -ex; \ 17 | \ 18 | apk add --no-cache --virtual .build-deps \ 19 | $PHPIZE_DEPS \ 20 | autoconf \ 21 | freetype-dev \ 22 | icu-dev \ 23 | libevent-dev \ 24 | libjpeg-turbo-dev \ 25 | libmcrypt-dev \ 26 | libpng-dev \ 27 | libmemcached-dev \ 28 | libxml2-dev \ 29 | libzip-dev \ 30 | openldap-dev \ 31 | pcre-dev \ 32 | postgresql-dev \ 33 | imagemagick-dev \ 34 | libwebp-dev \ 35 | gmp-dev \ 36 | ; \ 37 | \ 38 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 39 | docker-php-ext-configure ldap; \ 40 | docker-php-ext-install -j "$(nproc)" \ 41 | bcmath \ 42 | exif \ 43 | gd \ 44 | intl \ 45 | ldap \ 46 | opcache \ 47 | pcntl \ 48 | pdo_mysql \ 49 | pdo_pgsql \ 50 | zip \ 51 | gmp \ 52 | ; \ 53 | \ 54 | # pecl will claim success even if one install fails, so we need to perform each install separately 55 | pecl install APCu-5.1.21; \ 56 | pecl install memcached-3.2.0RC1; \ 57 | pecl install redis-5.3.7; \ 58 | pecl install imagick-3.7.0; \ 59 | \ 60 | docker-php-ext-enable \ 61 | apcu \ 62 | memcached \ 63 | redis \ 64 | imagick \ 65 | ; \ 66 | rm -r /tmp/pear; \ 67 | \ 68 | runDeps="$( \ 69 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 70 | | tr ',' '\n' \ 71 | | sort -u \ 72 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 73 | )"; \ 74 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 75 | apk del .build-deps 76 | 77 | # set recommended PHP.ini settings 78 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 79 | ENV PHP_MEMORY_LIMIT 512M 80 | ENV PHP_UPLOAD_LIMIT 512M 81 | RUN { \ 82 | echo 'opcache.enable=1'; \ 83 | echo 'opcache.interned_strings_buffer=8'; \ 84 | echo 'opcache.max_accelerated_files=10000'; \ 85 | echo 'opcache.memory_consumption=128'; \ 86 | echo 'opcache.save_comments=1'; \ 87 | echo 'opcache.revalidate_freq=1'; \ 88 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 89 | \ 90 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 91 | \ 92 | { \ 93 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 94 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 95 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 96 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 97 | \ 98 | mkdir /var/www/data; \ 99 | chown -R www-data:root /var/www; \ 100 | chmod -R g=u /var/www 101 | 102 | VOLUME /var/www/html 103 | 104 | 105 | ENV NEXTCLOUD_VERSION 22.2.5 106 | 107 | RUN set -ex; \ 108 | apk add --no-cache --virtual .fetch-deps \ 109 | bzip2 \ 110 | gnupg \ 111 | ; \ 112 | \ 113 | curl -fsSL -o nextcloud.tar.bz2 \ 114 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 115 | curl -fsSL -o nextcloud.tar.bz2.asc \ 116 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 117 | export GNUPGHOME="$(mktemp -d)"; \ 118 | # gpg key from https://nextcloud.com/nextcloud.asc 119 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 120 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 121 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 122 | gpgconf --kill all; \ 123 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 124 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 125 | mkdir -p /usr/src/nextcloud/data; \ 126 | mkdir -p /usr/src/nextcloud/custom_apps; \ 127 | chmod +x /usr/src/nextcloud/occ; \ 128 | apk del .fetch-deps 129 | 130 | COPY *.sh upgrade.exclude / 131 | COPY config/* /usr/src/nextcloud/config/ 132 | 133 | ENTRYPOINT ["/entrypoint.sh"] 134 | CMD ["php-fpm"] 135 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /22/fpm-alpine/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /22/fpm-alpine/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /22/fpm-alpine/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /22/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template... 2 | FROM php:8.0-fpm-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | 117 | ENV NEXTCLOUD_VERSION 22.2.5 118 | 119 | RUN set -ex; \ 120 | fetchDeps=" \ 121 | gnupg \ 122 | dirmngr \ 123 | "; \ 124 | apt-get update; \ 125 | apt-get install -y --no-install-recommends $fetchDeps; \ 126 | \ 127 | curl -fsSL -o nextcloud.tar.bz2 \ 128 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 129 | curl -fsSL -o nextcloud.tar.bz2.asc \ 130 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 131 | export GNUPGHOME="$(mktemp -d)"; \ 132 | # gpg key from https://nextcloud.com/nextcloud.asc 133 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 134 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 135 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 136 | gpgconf --kill all; \ 137 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 138 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 139 | mkdir -p /usr/src/nextcloud/data; \ 140 | mkdir -p /usr/src/nextcloud/custom_apps; \ 141 | chmod +x /usr/src/nextcloud/occ; \ 142 | \ 143 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 144 | rm -rf /var/lib/apt/lists/* 145 | 146 | COPY *.sh upgrade.exclude / 147 | COPY config/* /usr/src/nextcloud/config/ 148 | 149 | ENTRYPOINT ["/entrypoint.sh"] 150 | CMD ["php-fpm"] 151 | -------------------------------------------------------------------------------- /22/fpm/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /22/fpm/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /22/fpm/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /22/fpm/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /22/fpm/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /22/fpm/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /22/fpm/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /22/fpm/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /23/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template/// 2 | FROM php:8.0-apache-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | RUN a2enmod headers rewrite remoteip ;\ 117 | {\ 118 | echo RemoteIPHeader X-Real-IP ;\ 119 | echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ 120 | echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ 121 | echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ 122 | } > /etc/apache2/conf-available/remoteip.conf;\ 123 | a2enconf remoteip 124 | 125 | ENV NEXTCLOUD_VERSION 23.0.2 126 | 127 | RUN set -ex; \ 128 | fetchDeps=" \ 129 | gnupg \ 130 | dirmngr \ 131 | "; \ 132 | apt-get update; \ 133 | apt-get install -y --no-install-recommends $fetchDeps; \ 134 | \ 135 | curl -fsSL -o nextcloud.tar.bz2 \ 136 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 137 | curl -fsSL -o nextcloud.tar.bz2.asc \ 138 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 139 | export GNUPGHOME="$(mktemp -d)"; \ 140 | # gpg key from https://nextcloud.com/nextcloud.asc 141 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 142 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 143 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 144 | gpgconf --kill all; \ 145 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 146 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 147 | mkdir -p /usr/src/nextcloud/data; \ 148 | mkdir -p /usr/src/nextcloud/custom_apps; \ 149 | chmod +x /usr/src/nextcloud/occ; \ 150 | \ 151 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 152 | rm -rf /var/lib/apt/lists/* 153 | 154 | COPY *.sh upgrade.exclude / 155 | COPY config/* /usr/src/nextcloud/config/ 156 | 157 | ENTRYPOINT ["/entrypoint.sh"] 158 | CMD ["apache2-foreground"] 159 | -------------------------------------------------------------------------------- /23/apache/config/apache-pretty-urls.config.php: -------------------------------------------------------------------------------- 1 | '/', 4 | ); 5 | -------------------------------------------------------------------------------- /23/apache/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /23/apache/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /23/apache/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /23/apache/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /23/apache/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /23/apache/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /23/apache/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /23/apache/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /23/fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template 2 | FROM php:8.0-fpm-alpine3.15 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apk add --no-cache \ 8 | rsync \ 9 | ; \ 10 | \ 11 | rm /var/spool/cron/crontabs/root; \ 12 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 13 | 14 | # install the PHP extensions we need 15 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 16 | RUN set -ex; \ 17 | \ 18 | apk add --no-cache --virtual .build-deps \ 19 | $PHPIZE_DEPS \ 20 | autoconf \ 21 | freetype-dev \ 22 | icu-dev \ 23 | libevent-dev \ 24 | libjpeg-turbo-dev \ 25 | libmcrypt-dev \ 26 | libpng-dev \ 27 | libmemcached-dev \ 28 | libxml2-dev \ 29 | libzip-dev \ 30 | openldap-dev \ 31 | pcre-dev \ 32 | postgresql-dev \ 33 | imagemagick-dev \ 34 | libwebp-dev \ 35 | gmp-dev \ 36 | ; \ 37 | \ 38 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 39 | docker-php-ext-configure ldap; \ 40 | docker-php-ext-install -j "$(nproc)" \ 41 | bcmath \ 42 | exif \ 43 | gd \ 44 | intl \ 45 | ldap \ 46 | opcache \ 47 | pcntl \ 48 | pdo_mysql \ 49 | pdo_pgsql \ 50 | zip \ 51 | gmp \ 52 | ; \ 53 | \ 54 | # pecl will claim success even if one install fails, so we need to perform each install separately 55 | pecl install APCu-5.1.21; \ 56 | pecl install memcached-3.2.0RC1; \ 57 | pecl install redis-5.3.7; \ 58 | pecl install imagick-3.7.0; \ 59 | \ 60 | docker-php-ext-enable \ 61 | apcu \ 62 | memcached \ 63 | redis \ 64 | imagick \ 65 | ; \ 66 | rm -r /tmp/pear; \ 67 | \ 68 | runDeps="$( \ 69 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 70 | | tr ',' '\n' \ 71 | | sort -u \ 72 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 73 | )"; \ 74 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 75 | apk del .build-deps 76 | 77 | # set recommended PHP.ini settings 78 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 79 | ENV PHP_MEMORY_LIMIT 512M 80 | ENV PHP_UPLOAD_LIMIT 512M 81 | RUN { \ 82 | echo 'opcache.enable=1'; \ 83 | echo 'opcache.interned_strings_buffer=8'; \ 84 | echo 'opcache.max_accelerated_files=10000'; \ 85 | echo 'opcache.memory_consumption=128'; \ 86 | echo 'opcache.save_comments=1'; \ 87 | echo 'opcache.revalidate_freq=1'; \ 88 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 89 | \ 90 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 91 | \ 92 | { \ 93 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 94 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 95 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 96 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 97 | \ 98 | mkdir /var/www/data; \ 99 | chown -R www-data:root /var/www; \ 100 | chmod -R g=u /var/www 101 | 102 | VOLUME /var/www/html 103 | 104 | 105 | ENV NEXTCLOUD_VERSION 23.0.2 106 | 107 | RUN set -ex; \ 108 | apk add --no-cache --virtual .fetch-deps \ 109 | bzip2 \ 110 | gnupg \ 111 | ; \ 112 | \ 113 | curl -fsSL -o nextcloud.tar.bz2 \ 114 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 115 | curl -fsSL -o nextcloud.tar.bz2.asc \ 116 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 117 | export GNUPGHOME="$(mktemp -d)"; \ 118 | # gpg key from https://nextcloud.com/nextcloud.asc 119 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 120 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 121 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 122 | gpgconf --kill all; \ 123 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 124 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 125 | mkdir -p /usr/src/nextcloud/data; \ 126 | mkdir -p /usr/src/nextcloud/custom_apps; \ 127 | chmod +x /usr/src/nextcloud/occ; \ 128 | apk del .fetch-deps 129 | 130 | COPY *.sh upgrade.exclude / 131 | COPY config/* /usr/src/nextcloud/config/ 132 | 133 | ENTRYPOINT ["/entrypoint.sh"] 134 | CMD ["php-fpm"] 135 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /23/fpm-alpine/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /23/fpm-alpine/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /23/fpm-alpine/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /23/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: created by update.sh from Dockerfile-debian.template 2 | FROM php:8.0-fpm-bullseye 3 | 4 | # entrypoint.sh and cron.sh dependencies 5 | RUN set -ex; \ 6 | \ 7 | apt-get update; \ 8 | apt-get install -y --no-install-recommends \ 9 | rsync \ 10 | bzip2 \ 11 | busybox-static \ 12 | libldap-common \ 13 | ; \ 14 | rm -rf /var/lib/apt/lists/*; \ 15 | \ 16 | mkdir -p /var/spool/cron/crontabs; \ 17 | echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 18 | 19 | # install the PHP extensions we need 20 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 21 | ENV PHP_MEMORY_LIMIT 512M 22 | ENV PHP_UPLOAD_LIMIT 512M 23 | RUN set -ex; \ 24 | \ 25 | savedAptMark="$(apt-mark showmanual)"; \ 26 | \ 27 | apt-get update; \ 28 | apt-get install -y --no-install-recommends \ 29 | libcurl4-openssl-dev \ 30 | libevent-dev \ 31 | libfreetype6-dev \ 32 | libicu-dev \ 33 | libjpeg-dev \ 34 | libldap2-dev \ 35 | libmcrypt-dev \ 36 | libmemcached-dev \ 37 | libpng-dev \ 38 | libpq-dev \ 39 | libxml2-dev \ 40 | libmagickwand-dev \ 41 | libzip-dev \ 42 | libwebp-dev \ 43 | libgmp-dev \ 44 | ; \ 45 | \ 46 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 49 | docker-php-ext-install -j "$(nproc)" \ 50 | bcmath \ 51 | exif \ 52 | gd \ 53 | intl \ 54 | ldap \ 55 | opcache \ 56 | pcntl \ 57 | pdo_mysql \ 58 | pdo_pgsql \ 59 | zip \ 60 | gmp \ 61 | ; \ 62 | \ 63 | # pecl will claim success even if one install fails, so we need to perform each install separately 64 | pecl install APCu-5.1.21; \ 65 | pecl install memcached-3.2.0RC1; \ 66 | pecl install redis-5.3.7; \ 67 | pecl install imagick-3.7.0; \ 68 | \ 69 | docker-php-ext-enable \ 70 | apcu \ 71 | memcached \ 72 | redis \ 73 | imagick \ 74 | ; \ 75 | rm -r /tmp/pear; \ 76 | \ 77 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 78 | apt-mark auto '.*' > /dev/null; \ 79 | apt-mark manual $savedAptMark; \ 80 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 81 | | awk '/=>/ { print $3 }' \ 82 | | sort -u \ 83 | | xargs -r dpkg-query -S \ 84 | | cut -d: -f1 \ 85 | | sort -u \ 86 | | xargs -rt apt-mark manual; \ 87 | \ 88 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 89 | rm -rf /var/lib/apt/lists/* 90 | 91 | # set recommended PHP.ini settings 92 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 93 | RUN { \ 94 | echo 'opcache.enable=1'; \ 95 | echo 'opcache.interned_strings_buffer=8'; \ 96 | echo 'opcache.max_accelerated_files=10000'; \ 97 | echo 'opcache.memory_consumption=128'; \ 98 | echo 'opcache.save_comments=1'; \ 99 | echo 'opcache.revalidate_freq=1'; \ 100 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 101 | \ 102 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 103 | \ 104 | { \ 105 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 106 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 107 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 108 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 109 | \ 110 | mkdir /var/www/data; \ 111 | chown -R www-data:root /var/www; \ 112 | chmod -R g=u /var/www 113 | 114 | VOLUME /var/www/html 115 | 116 | 117 | ENV NEXTCLOUD_VERSION 23.0.2 118 | 119 | RUN set -ex; \ 120 | fetchDeps=" \ 121 | gnupg \ 122 | dirmngr \ 123 | "; \ 124 | apt-get update; \ 125 | apt-get install -y --no-install-recommends $fetchDeps; \ 126 | \ 127 | curl -fsSL -o nextcloud.tar.bz2 \ 128 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 129 | curl -fsSL -o nextcloud.tar.bz2.asc \ 130 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 131 | export GNUPGHOME="$(mktemp -d)"; \ 132 | # gpg key from https://nextcloud.com/nextcloud.asc 133 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 134 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 135 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 136 | gpgconf --kill all; \ 137 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 138 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 139 | mkdir -p /usr/src/nextcloud/data; \ 140 | mkdir -p /usr/src/nextcloud/custom_apps; \ 141 | chmod +x /usr/src/nextcloud/occ; \ 142 | \ 143 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 144 | rm -rf /var/lib/apt/lists/* 145 | 146 | COPY *.sh upgrade.exclude / 147 | COPY config/* /usr/src/nextcloud/config/ 148 | 149 | ENTRYPOINT ["/entrypoint.sh"] 150 | CMD ["php-fpm"] 151 | -------------------------------------------------------------------------------- /23/fpm/config/apcu.config.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\APCu', 4 | ); 5 | -------------------------------------------------------------------------------- /23/fpm/config/apps.config.php: -------------------------------------------------------------------------------- 1 | array ( 4 | 0 => array ( 5 | 'path' => OC::$SERVERROOT.'/apps', 6 | 'url' => '/apps', 7 | 'writable' => false, 8 | ), 9 | 1 => array ( 10 | 'path' => OC::$SERVERROOT.'/custom_apps', 11 | 'url' => '/custom_apps', 12 | 'writable' => true, 13 | ), 14 | ), 15 | ); 16 | -------------------------------------------------------------------------------- /23/fpm/config/autoconfig.php: -------------------------------------------------------------------------------- 1 | '\OC\Memcache\Redis', 5 | 'memcache.locking' => '\OC\Memcache\Redis', 6 | 'redis' => array( 7 | 'host' => getenv('REDIS_HOST'), 8 | 'password' => (string) getenv('REDIS_HOST_PASSWORD'), 9 | ), 10 | ); 11 | 12 | if (getenv('REDIS_HOST_PORT') !== false) { 13 | $CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT'); 14 | } elseif (getenv('REDIS_HOST')[0] != '/') { 15 | $CONFIG['redis']['port'] = 6379; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /23/fpm/config/reverse-proxy.config.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'class' => '\OC\Files\ObjectStore\S3', 10 | 'arguments' => array( 11 | 'bucket' => getenv('OBJECTSTORE_S3_BUCKET'), 12 | 'key' => getenv('OBJECTSTORE_S3_KEY') ?: '', 13 | 'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '', 14 | 'region' => getenv('OBJECTSTORE_S3_REGION') ?: '', 15 | 'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '', 16 | 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 17 | 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 18 | 'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 19 | 'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 20 | // required for some non Amazon S3 implementations 21 | 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 22 | // required for older protocol versions 23 | 'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false' 24 | ) 25 | ) 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /23/fpm/config/smtp.config.php: -------------------------------------------------------------------------------- 1 | 'smtp', 5 | 'mail_smtphost' => getenv('SMTP_HOST'), 6 | 'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25), 7 | 'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '', 8 | 'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'), 9 | 'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN', 10 | 'mail_smtpname' => getenv('SMTP_NAME') ?: '', 11 | 'mail_from_address' => getenv('MAIL_FROM_ADDRESS'), 12 | 'mail_domain' => getenv('MAIL_DOMAIN'), 13 | ); 14 | 15 | if (getenv('SMTP_PASSWORD_FILE') && file_exists(getenv('SMTP_PASSWORD_FILE'))) { 16 | $CONFIG['mail_smtppassword'] = trim(file_get_contents(getenv('SMTP_PASSWORD_FILE'))); 17 | } elseif (getenv('SMTP_PASSWORD')) { 18 | $CONFIG['mail_smtppassword'] = getenv('SMTP_PASSWORD'); 19 | } else { 20 | $CONFIG['mail_smtppassword'] = ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /23/fpm/config/swift.config.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'class' => 'OC\\Files\\ObjectStore\\Swift', 7 | 'arguments' => [ 8 | 'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false', 9 | 'user' => [ 10 | 'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'), 11 | 'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'), 12 | 'domain' => [ 13 | 'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default', 14 | ], 15 | ], 16 | 'scope' => [ 17 | 'project' => [ 18 | 'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'), 19 | 'domain' => [ 20 | 'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default', 21 | ], 22 | ], 23 | ], 24 | 'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift', 25 | 'region' => getenv('OBJECTSTORE_SWIFT_REGION'), 26 | 'url' => getenv('OBJECTSTORE_SWIFT_URL'), 27 | 'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'), 28 | ] 29 | ] 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /23/fpm/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | -------------------------------------------------------------------------------- /23/fpm/upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | In the Nextcloud community, participants from all over the world come together to create Free Software for a free internet. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use Nextcloud software. 2 | 3 | Our code of conduct offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other. 4 | 5 | The Code of Conduct is shared by all contributors and users who engage with the Nextcloud team and its community services. It presents a summary of the shared values and “common sense” thinking in our community. 6 | 7 | You can find our full code of conduct on our website: https://nextcloud.com/code-of-conduct/ 8 | 9 | Please, keep our CoC in mind when you contribute! That way, everyone can be a part of our community in a productive, positive, creative and fun way. 10 | -------------------------------------------------------------------------------- /Dockerfile-alpine.template: -------------------------------------------------------------------------------- 1 | FROM php:%%PHP_VERSION%%-%%VARIANT%%3.15 2 | 3 | # entrypoint.sh and cron.sh dependencies 4 | RUN set -ex; \ 5 | \ 6 | apk add --no-cache \ 7 | rsync \ 8 | ; \ 9 | \ 10 | rm /var/spool/cron/crontabs/root; \ 11 | echo '*/%%CRONTAB_INT%% * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 12 | 13 | # install the PHP extensions we need 14 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 15 | RUN set -ex; \ 16 | \ 17 | apk add --no-cache --virtual .build-deps \ 18 | $PHPIZE_DEPS \ 19 | autoconf \ 20 | freetype-dev \ 21 | icu-dev \ 22 | libevent-dev \ 23 | libjpeg-turbo-dev \ 24 | libmcrypt-dev \ 25 | libpng-dev \ 26 | libmemcached-dev \ 27 | libxml2-dev \ 28 | libzip-dev \ 29 | openldap-dev \ 30 | pcre-dev \ 31 | postgresql-dev \ 32 | imagemagick-dev \ 33 | libwebp-dev \ 34 | gmp-dev \ 35 | ; \ 36 | \ 37 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 38 | docker-php-ext-configure ldap; \ 39 | docker-php-ext-install -j "$(nproc)" \ 40 | bcmath \ 41 | exif \ 42 | gd \ 43 | intl \ 44 | ldap \ 45 | opcache \ 46 | pcntl \ 47 | pdo_mysql \ 48 | pdo_pgsql \ 49 | zip \ 50 | gmp \ 51 | ; \ 52 | \ 53 | # pecl will claim success even if one install fails, so we need to perform each install separately 54 | pecl install APCu-%%APCU_VERSION%%; \ 55 | pecl install memcached-%%MEMCACHED_VERSION%%; \ 56 | pecl install redis-%%REDIS_VERSION%%; \ 57 | pecl install imagick-%%IMAGICK_VERSION%%; \ 58 | \ 59 | docker-php-ext-enable \ 60 | apcu \ 61 | memcached \ 62 | redis \ 63 | imagick \ 64 | ; \ 65 | rm -r /tmp/pear; \ 66 | \ 67 | runDeps="$( \ 68 | scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ 69 | | tr ',' '\n' \ 70 | | sort -u \ 71 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 72 | )"; \ 73 | apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ 74 | apk del .build-deps 75 | 76 | # set recommended PHP.ini settings 77 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 78 | ENV PHP_MEMORY_LIMIT 512M 79 | ENV PHP_UPLOAD_LIMIT 512M 80 | RUN { \ 81 | echo 'opcache.enable=1'; \ 82 | echo 'opcache.interned_strings_buffer=8'; \ 83 | echo 'opcache.max_accelerated_files=10000'; \ 84 | echo 'opcache.memory_consumption=128'; \ 85 | echo 'opcache.save_comments=1'; \ 86 | echo 'opcache.revalidate_freq=1'; \ 87 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 88 | \ 89 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 90 | \ 91 | { \ 92 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 93 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 94 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 95 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 96 | \ 97 | mkdir /var/www/data; \ 98 | chown -R www-data:root /var/www; \ 99 | chmod -R g=u /var/www 100 | 101 | VOLUME /var/www/html 102 | %%VARIANT_EXTRAS%% 103 | 104 | ENV NEXTCLOUD_VERSION %%VERSION%% 105 | 106 | RUN set -ex; \ 107 | apk add --no-cache --virtual .fetch-deps \ 108 | bzip2 \ 109 | gnupg \ 110 | ; \ 111 | \ 112 | curl -fsSL -o nextcloud.tar.bz2 \ 113 | "%%BASE_DOWNLOAD_URL%%/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 114 | curl -fsSL -o nextcloud.tar.bz2.asc \ 115 | "%%BASE_DOWNLOAD_URL%%/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 116 | export GNUPGHOME="$(mktemp -d)"; \ 117 | # gpg key from https://nextcloud.com/nextcloud.asc 118 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 119 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 120 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 121 | gpgconf --kill all; \ 122 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 123 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 124 | mkdir -p /usr/src/nextcloud/data; \ 125 | mkdir -p /usr/src/nextcloud/custom_apps; \ 126 | chmod +x /usr/src/nextcloud/occ; \ 127 | apk del .fetch-deps 128 | 129 | COPY *.sh upgrade.exclude / 130 | COPY config/* /usr/src/nextcloud/config/ 131 | 132 | ENTRYPOINT ["/entrypoint.sh"] 133 | CMD ["%%CMD%%"] 134 | -------------------------------------------------------------------------------- /Dockerfile-debian.template: -------------------------------------------------------------------------------- 1 | FROM php:%%PHP_VERSION%%-%%VARIANT%%-bullseye 2 | 3 | # entrypoint.sh and cron.sh dependencies, 4 | RUN set -ex; \ 5 | \ 6 | apt-get update; \ 7 | apt-get install -y --no-install-recommends \ 8 | rsync \ 9 | bzip2 \ 10 | busybox-static \ 11 | libldap-common \ 12 | ; \ 13 | rm -rf /var/lib/apt/lists/*; \ 14 | \ 15 | mkdir -p /var/spool/cron/crontabs; \ 16 | echo '*/%%CRONTAB_INT%% * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data 17 | 18 | # install the PHP extensions we need 19 | # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html 20 | ENV PHP_MEMORY_LIMIT 512M 21 | ENV PHP_UPLOAD_LIMIT 512M 22 | RUN set -ex; \ 23 | \ 24 | savedAptMark="$(apt-mark showmanual)"; \ 25 | \ 26 | apt-get update; \ 27 | apt-get install -y --no-install-recommends \ 28 | libcurl4-openssl-dev \ 29 | libevent-dev \ 30 | libfreetype6-dev \ 31 | libicu-dev \ 32 | libjpeg-dev \ 33 | libldap2-dev \ 34 | libmcrypt-dev \ 35 | libmemcached-dev \ 36 | libpng-dev \ 37 | libpq-dev \ 38 | libxml2-dev \ 39 | libmagickwand-dev \ 40 | libzip-dev \ 41 | libwebp-dev \ 42 | libgmp-dev \ 43 | ; \ 44 | \ 45 | debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ 46 | if [ ! -e /usr/include/gmp.h ]; then ln -s /usr/include/$debMultiarch/gmp.h /usr/include/gmp.h; fi;\ 47 | docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ 48 | docker-php-ext-configure gmp --with-gmp="/usr/include/$debMultiarch"; \ 49 | docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ 50 | docker-php-ext-install -j "$(nproc)" \ 51 | bcmath \ 52 | exif \ 53 | gd \ 54 | intl \ 55 | ldap \ 56 | opcache \ 57 | pcntl \ 58 | pdo_mysql \ 59 | pdo_pgsql \ 60 | zip \ 61 | gmp \ 62 | ; \ 63 | \ 64 | # pecl will claim success even if one install fails, so we need to perform each install separately 65 | pecl install APCu-%%APCU_VERSION%%; \ 66 | pecl install memcached-%%MEMCACHED_VERSION%%; \ 67 | pecl install redis-%%REDIS_VERSION%%; \ 68 | pecl install imagick-%%IMAGICK_VERSION%%; \ 69 | \ 70 | docker-php-ext-enable \ 71 | apcu \ 72 | memcached \ 73 | redis \ 74 | imagick \ 75 | ; \ 76 | rm -r /tmp/pear; \ 77 | \ 78 | # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies 79 | apt-mark auto '.*' > /dev/null; \ 80 | apt-mark manual $savedAptMark; \ 81 | ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ 82 | | awk '/=>/ { print $3 }' \ 83 | | sort -u \ 84 | | xargs -r dpkg-query -S \ 85 | | cut -d: -f1 \ 86 | | sort -u \ 87 | | xargs -rt apt-mark manual; \ 88 | \ 89 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ 90 | rm -rf /var/lib/apt/lists/* 91 | 92 | # set recommended PHP.ini settings 93 | # see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache 94 | RUN { \ 95 | echo 'opcache.enable=1'; \ 96 | echo 'opcache.interned_strings_buffer=8'; \ 97 | echo 'opcache.max_accelerated_files=10000'; \ 98 | echo 'opcache.memory_consumption=128'; \ 99 | echo 'opcache.save_comments=1'; \ 100 | echo 'opcache.revalidate_freq=1'; \ 101 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ 102 | \ 103 | echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \ 104 | \ 105 | { \ 106 | echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \ 107 | echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \ 108 | echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \ 109 | } > /usr/local/etc/php/conf.d/nextcloud.ini; \ 110 | \ 111 | mkdir /var/www/data; \ 112 | chown -R www-data:root /var/www; \ 113 | chmod -R g=u /var/www 114 | 115 | VOLUME /var/www/html 116 | %%VARIANT_EXTRAS%% 117 | 118 | ENV NEXTCLOUD_VERSION %%VERSION%% 119 | 120 | RUN set -ex; \ 121 | fetchDeps=" \ 122 | gnupg \ 123 | dirmngr \ 124 | "; \ 125 | apt-get update; \ 126 | apt-get install -y --no-install-recommends $fetchDeps; \ 127 | \ 128 | curl -fsSL -o nextcloud.tar.bz2 \ 129 | "%%BASE_DOWNLOAD_URL%%/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \ 130 | curl -fsSL -o nextcloud.tar.bz2.asc \ 131 | "%%BASE_DOWNLOAD_URL%%/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \ 132 | export GNUPGHOME="$(mktemp -d)"; \ 133 | # gpg key from https://nextcloud.com/nextcloud.asc 134 | gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \ 135 | gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 136 | tar -xjf nextcloud.tar.bz2 -C /usr/src/; \ 137 | gpgconf --kill all; \ 138 | rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \ 139 | rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \ 140 | mkdir -p /usr/src/nextcloud/data; \ 141 | mkdir -p /usr/src/nextcloud/custom_apps; \ 142 | chmod +x /usr/src/nextcloud/occ; \ 143 | \ 144 | apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \ 145 | rm -rf /var/lib/apt/lists/* 146 | 147 | COPY *.sh upgrade.exclude / 148 | COPY config/* /usr/src/nextcloud/config/ 149 | 150 | ENTRYPOINT ["/entrypoint.sh"] 151 | CMD ["%%CMD%%"] 152 | -------------------------------------------------------------------------------- /docker-cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | exec busybox crond -f -l 0 -L /dev/stdout 5 | # very important...//...,, 6 | -------------------------------------------------------------------------------- /generate-stackbrew-library.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -Eeuo pipefail 3 | 4 | stable_channel='22.2.5' 5 | 6 | self="$(basename "$BASH_SOURCE")" 7 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 8 | 9 | # Get the most recent commit which modified any of "$@". 10 | fileCommit() { 11 | commit="$(git log -1 --format='format:%H' HEAD -- "$@")" 12 | if [ -z "$commit" ]; then 13 | # return some valid sha1 hash to make bashbrew happy 14 | echo '0000000000000000000000000000000000000000' 15 | else 16 | echo "$commit" 17 | fi 18 | } 19 | 20 | # Get the most recent commit which modified "$1/Dockerfile" or any file that 21 | # the Dockerfile copies into the rootfs (with COPY). 22 | dockerfileCommit() { 23 | local dir="$1"; shift 24 | ( 25 | cd "$dir"; 26 | fileCommit Dockerfile \ 27 | $(awk ' 28 | toupper($1) == "COPY" { 29 | for (i = 2; i < NF; i++) 30 | print $i; 31 | } 32 | ' Dockerfile) 33 | ) 34 | } 35 | 36 | getArches() { 37 | local repo="$1"; shift 38 | local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' 39 | 40 | eval "declare -g -A parentRepoToArches=( $( 41 | find -maxdepth 3 -name 'Dockerfile' -exec awk ' 42 | toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ { 43 | print "'"$officialImagesUrl"'" $2 44 | } 45 | ' '{}' + \ 46 | | sort -u \ 47 | | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' 48 | ) )" 49 | } 50 | getArches 'nextcloud' 51 | 52 | # Header. 53 | cat <<-EOH 54 | # This file is generated via https://github.com/nextcloud/docker/blob/$(fileCommit "$self")/$self 55 | 56 | Maintainers: Nextcloud (@nextcloud) 57 | GitRepo: https://github.com/nextcloud/docker.git 58 | EOH 59 | 60 | # prints "$2$1$3$1...$N" 61 | join() { 62 | local sep="$1"; shift 63 | local out; printf -v out "${sep//%/%%}%s" "$@" 64 | echo "${out#$sep}" 65 | } 66 | 67 | latest=$( cat latest.txt ) 68 | 69 | # Generate each of the tags. 70 | versions=( */ ) 71 | versions=( "${versions[@]%/}" ) 72 | for version in "${versions[@]}"; do 73 | variants=( $version/*/ ) 74 | variants=( $(for variant in "${variants[@]%/}"; do 75 | echo "$(basename "$variant")" 76 | done) ) 77 | for variant in "${variants[@]}"; do 78 | commit="$(dockerfileCommit "$version/$variant")" 79 | fullversion_with_extension="$( awk '$1 == "ENV" && $2 == "NEXTCLOUD_VERSION" { print $3; exit }' "$version/$variant/Dockerfile" )" 80 | fullversion="$( echo "$fullversion_with_extension" | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}')" 81 | 82 | versionAliases=( ) 83 | versionPostfix="" 84 | if [ "$fullversion_with_extension" != "$fullversion" ]; then 85 | versionAliases=( "$fullversion_with_extension" ) 86 | versionPostfix="-$( echo "$fullversion_with_extension" | tr '[:upper:]' '[:lower:]' | grep -oE '(beta|rc|alpha)')" 87 | fi 88 | 89 | versionAliases+=( "$fullversion$versionPostfix" "${fullversion%.*}$versionPostfix" "${fullversion%.*.*}$versionPostfix" ) 90 | if [ "$fullversion_with_extension" = "$latest" ]; then 91 | versionAliases+=( "latest" ) 92 | fi 93 | 94 | if [ "$fullversion_with_extension" = "$stable_channel" ]; then 95 | versionAliases+=( "stable" "production" ) 96 | fi 97 | 98 | variantAliases=( "${versionAliases[@]/%/-$variant}" ) 99 | variantAliases=( "${variantAliases[@]//latest-}" ) 100 | 101 | if [ "$variant" = "apache" ]; then 102 | variantAliases+=( "${versionAliases[@]}" ) 103 | fi 104 | 105 | variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/$variant/Dockerfile")" 106 | variantArches="${parentRepoToArches[$variantParent]}" 107 | 108 | cat <<-EOE 109 | 110 | Tags: $(join ', ' "${variantAliases[@]}") 111 | Architectures: $(join ', ' $variantArches) 112 | GitCommit: $commit 113 | Directory: $version/$variant 114 | EOE 115 | done 116 | done 117 | -------------------------------------------------------------------------------- /latest.txt: -------------------------------------------------------------------------------- 1 | 23.0.2 2 | -------------------------------------------------------------------------------- /stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.2' 2 | 3 | services: 4 | db: 5 | image: postgres 6 | restart: always 7 | volumes: 8 | - db:/var/lib/postgresql/data 9 | environment: 10 | - POSTGRES_DB=nextcloud 11 | - POSTGRES_USER=nextcloud 12 | - POSTGRES_PASSWORD=nextcloud 13 | 14 | app: 15 | image: nextcloud 16 | restart: always 17 | ports: 18 | - 8080:80 19 | volumes: 20 | - nextcloud:/var/www/html 21 | environment: 22 | - POSTGRES_HOST=db 23 | - POSTGRES_DB=nextcloud 24 | - POSTGRES_USER=nextcloud 25 | - POSTGRES_PASSWORD=nextcloud 26 | depends_on: 27 | - db 28 | 29 | cron: 30 | image: nextcloud 31 | restart: always 32 | volumes: 33 | - nextcloud:/var/www/html 34 | entrypoint: /cron.sh 35 | depends_on: 36 | - db 37 | 38 | volumes: 39 | db: 40 | nextcloud: 41 | 42 | #very imort 43 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eo pipefail 3 | 4 | declare -A php_version=( 5 | [default]='8.0' 6 | [21]='7.4' 7 | ) 8 | 9 | declare -A cmd=( 10 | [apache]='apache2-foreground' 11 | [fpm]='php-fpm' 12 | [fpm-alpine]='php-fpm' 13 | ) 14 | 15 | declare -A base=( 16 | [apache]='debian' 17 | [fpm]='debian' 18 | [fpm-alpine]='alpine' 19 | ) 20 | 21 | declare -A extras=( 22 | [apache]='\nRUN a2enmod headers rewrite remoteip ;\\\n {\\\n echo RemoteIPHeader X-Real-IP ;\\\n echo RemoteIPTrustedProxy 10.0.0.0/8 ;\\\n echo RemoteIPTrustedProxy 172.16.0.0/12 ;\\\n echo RemoteIPTrustedProxy 192.168.0.0/16 ;\\\n } > /etc/apache2/conf-available/remoteip.conf;\\\n a2enconf remoteip' 23 | [fpm]='' 24 | [fpm-alpine]='' 25 | ) 26 | 27 | declare -A crontab_int=( 28 | [default]='5' 29 | ) 30 | 31 | apcu_version="$( 32 | git ls-remote --tags https://github.com/krakjoe/apcu.git \ 33 | | cut -d/ -f3 \ 34 | | grep -vE -- '-rc|-b' \ 35 | | sed -E 's/^v//' \ 36 | | sort -V \ 37 | | tail -1 38 | )" 39 | 40 | memcached_version="$( 41 | git ls-remote --tags https://github.com/php-memcached-dev/php-memcached.git \ 42 | | cut -d/ -f3 \ 43 | | grep -vE -- '-rc|-b' \ 44 | | sed -E 's/^[rv]//' \ 45 | | sort -V \ 46 | | tail -1 47 | )" 48 | 49 | redis_version="$( 50 | git ls-remote --tags https://github.com/phpredis/phpredis.git \ 51 | | cut -d/ -f3 \ 52 | | grep -viE '[a-z]' \ 53 | | tr -d '^{}' \ 54 | | sort -V \ 55 | | tail -1 56 | )" 57 | 58 | imagick_version="$( 59 | git ls-remote --tags https://github.com/mkoppanen/imagick.git \ 60 | | cut -d/ -f3 \ 61 | | grep -viE '[a-z]' \ 62 | | tr -d '^{}' \ 63 | | sort -V \ 64 | | tail -1 65 | )" 66 | 67 | declare -A pecl_versions=( 68 | [APCu]="$apcu_version" 69 | [memcached]="$memcached_version" 70 | [redis]="$redis_version" 71 | [imagick]="$imagick_version" 72 | ) 73 | 74 | variants=( 75 | apache 76 | fpm 77 | fpm-alpine 78 | ) 79 | 80 | min_version='21' 81 | 82 | # version_greater_or_equal A B returns whether A >= B 83 | function version_greater_or_equal() { 84 | [[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]]; 85 | } 86 | 87 | function create_variant() { 88 | dir="$1/$variant" 89 | phpVersion=${php_version[$version]-${php_version[default]}} 90 | crontabInt=${crontab_int[$version]-${crontab_int[default]}} 91 | 92 | # Create the version+variant directory with a Dockerfile. 93 | mkdir -p "$dir" 94 | 95 | template="Dockerfile-${base[$variant]}.template" 96 | echo "# DO NOT EDIT: created by update.sh from $template" > "$dir/Dockerfile" 97 | cat "$template" >> "$dir/Dockerfile" 98 | 99 | echo "updating $fullversion [$1] $variant" 100 | 101 | # Replace the variables. 102 | sed -ri -e ' 103 | s/%%PHP_VERSION%%/'"$phpVersion"'/g; 104 | s/%%VARIANT%%/'"$variant"'/g; 105 | s/%%VERSION%%/'"$fullversion"'/g; 106 | s/%%BASE_DOWNLOAD_URL%%/'"$2"'/g; 107 | s/%%CMD%%/'"${cmd[$variant]}"'/g; 108 | s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g; 109 | s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g; 110 | s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g; 111 | s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g; 112 | s/%%IMAGICK_VERSION%%/'"${pecl_versions[imagick]}"'/g; 113 | s/%%CRONTAB_INT%%/'"$crontabInt"'/g; 114 | ' "$dir/Dockerfile" 115 | 116 | case "$phpVersion" in 117 | 7.4|8.0 ) 118 | sed -ri -e ' 119 | \@docker-php-ext-configure gmp --with-gmp@d; 120 | \@/usr/include/gmp.h@d; 121 | ' "$dir/Dockerfile" 122 | ;; 123 | 7.3 ) 124 | sed -ri -e ' 125 | s@gd --with-freetype --with-jpeg --with-webp@gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr@g; 126 | ' "$dir/Dockerfile" 127 | ;; 128 | esac 129 | 130 | # Copy the shell scripts 131 | for name in entrypoint cron; do 132 | cp "docker-$name.sh" "$dir/$name.sh" 133 | done 134 | 135 | # Copy the upgrade.exclude 136 | cp upgrade.exclude "$dir/" 137 | 138 | # Copy the config directory 139 | cp -rT .config "$dir/config" 140 | 141 | # Remove Apache config if we're not an Apache variant. 142 | if [ "$variant" != "apache" ]; then 143 | rm "$dir/config/apache-pretty-urls.config.php" 144 | fi 145 | } 146 | 147 | curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \ 148 | grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \ 149 | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' | \ 150 | sort -uV | \ 151 | tail -1 > latest.txt 152 | 153 | find . -maxdepth 1 -type d -regextype sed -regex '\./[[:digit:]]\+\.[[:digit:]]\+\(-rc\|-beta\|-alpha\)\?' -exec rm -r '{}' \; 154 | 155 | fullversions=( $( curl -fsSL 'https://download.nextcloud.com/server/releases/' |tac|tac| \ 156 | grep -oE 'nextcloud-[[:digit:]]+(\.[[:digit:]]+){2}' | \ 157 | grep -oE '[[:digit:]]+(\.[[:digit:]]+){2}' | \ 158 | sort -urV ) ) 159 | versions=( $( printf '%s\n' "${fullversions[@]}" | cut -d. -f1 | sort -urV ) ) 160 | for version in "${versions[@]}"; do 161 | fullversion="$( printf '%s\n' "${fullversions[@]}" | grep -E "^$version" | head -1 )" 162 | 163 | if version_greater_or_equal "$version" "$min_version"; then 164 | 165 | for variant in "${variants[@]}"; do 166 | 167 | create_variant "$version" "https:\/\/download.nextcloud.com\/server\/releases" 168 | done 169 | fi 170 | done 171 | -------------------------------------------------------------------------------- /upgrade.exclude: -------------------------------------------------------------------------------- 1 | /config/ 2 | /data/ 3 | /custom_apps/ 4 | /themes/ 5 | /version.php 6 | --------------------------------------------------------------------------------