diff --git a/.github/workflows/epicmorg.advanced.nextcloud.images.yml b/.github/workflows/epicmorg.advanced.nextcloud.images.yml index effdbc807..19ff7ea0a 100644 --- a/.github/workflows/epicmorg.advanced.nextcloud.images.yml +++ b/.github/workflows/epicmorg.advanced.nextcloud.images.yml @@ -54,7 +54,10 @@ jobs: - name: "Build and Deploy Advanced Nextcloud 24 Stock Images:" run: cd linux/advanced/nextcloud/pure/24 && pwd && make build && make deploy - - name: "Build and Deploy Advanced Nextcloud Stock Images:" + - name: "Build and Deploy Advanced Nextcloud 25 Stock Images:" + run: cd linux/advanced/nextcloud/pure/25 && pwd && make build && make deploy + + - name: "Build and Deploy Advanced Nextcloud Latest Stock Images:" run: cd linux/advanced/nextcloud/pure/latest && pwd && make build && make deploy ################################################################################## @@ -104,7 +107,10 @@ jobs: - name: "Build and Deploy Advanced Nextcloud 24 Patched Images:" run: cd linux/advanced/nextcloud/patched/24 && pwd && make build && make deploy - - name: "Build and Deploy Advanced Nextcloud Patched Images:" + - name: "Build and Deploy Advanced Nextcloud 25 Patched Images:" + run: cd linux/advanced/nextcloud/patched/25 && pwd && make build && make deploy + + - name: "Build and Deploy Advanced Nextcloud Latest Patched Images:" run: cd linux/advanced/nextcloud/patched/latest && pwd && make build && make deploy ################################################################################## diff --git a/.github/workflows/epicmorg.base.images.postgresql.testing.yml b/.github/workflows/epicmorg.base.images.postgresql.testing.yml new file mode 100644 index 000000000..858120b55 --- /dev/null +++ b/.github/workflows/epicmorg.base.images.postgresql.testing.yml @@ -0,0 +1,30 @@ +name: EpicMorg EcoSystem PostgreSQL 16 Test Image + +on: +# push: +# branches: +# - 'master' + schedule: + - cron: '5 5 * * 1,3,5' + +jobs: + + build-pgsql16-images: + name: Build EpicMorg PostgreSQL 16 Test Image + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Log into registry + run: echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin + + - name: Test Make + run: make + + - name: "Build and Deploy PostgreSQL 16 Image:" + run: cd linux/ecosystem/postgres/16 && pwd && make build && make deploy + +################################################################################## + + - name: Cleanup + run: make docker-clean diff --git a/.github/workflows/epicmorg.base.images.postgresql.yml b/.github/workflows/epicmorg.base.images.postgresql.yml index a7eba38d9..626985b9d 100644 --- a/.github/workflows/epicmorg.base.images.postgresql.yml +++ b/.github/workflows/epicmorg.base.images.postgresql.yml @@ -69,8 +69,8 @@ jobs: - name: "Build and Deploy PostgreSQL 15 Image:" run: cd linux/ecosystem/postgres/15 && pwd && make build && make deploy - - name: "Build and Deploy PostgreSQL 16 Image:" - run: cd linux/ecosystem/postgres/16 && pwd && make build && make deploy +# - name: "Build and Deploy PostgreSQL 16 Image:" +# run: cd linux/ecosystem/postgres/16 && pwd && make build && make deploy ################################################################################## diff --git a/.github/workflows/epicmorg.base.images.web.yml b/.github/workflows/epicmorg.base.images.web.yml index 28f3a733e..8bb6c6af1 100644 --- a/.github/workflows/epicmorg.base.images.web.yml +++ b/.github/workflows/epicmorg.base.images.web.yml @@ -36,6 +36,9 @@ jobs: - name: "Build and Deploy PHP 8.0 Image:" run: cd linux/ecosystem/php/php8.0 && pwd && make build && make deploy + - name: "Build and Deploy PHP 8.1 Image:" + run: cd linux/ecosystem/php/php8.1 && pwd && make build && make deploy + ################################################################################## build-apache2-images: @@ -66,6 +69,9 @@ jobs: - name: "Build and Deploy Apache 2 + PHP 8.0 Image:" run: cd linux/ecosystem/apache2/php8.0 && pwd && make build && make deploy + - name: "Build and Deploy Apache 2 + PHP 8.1 Image:" + run: cd linux/ecosystem/apache2/php8.1 && pwd && make build && make deploy + ################################################################################## build-nginx-images: diff --git a/.github/workflows/epicmorg.ecosysctem.misc.images.yml b/.github/workflows/epicmorg.ecosysctem.misc.images.yml index 1d52ca82f..4296b4181 100644 --- a/.github/workflows/epicmorg.ecosysctem.misc.images.yml +++ b/.github/workflows/epicmorg.ecosysctem.misc.images.yml @@ -39,7 +39,7 @@ jobs: run: make - name: Build and Deploy Electron Release Server - run: cd llinux/ecosystem/electron-release-server && make build && make deploy + run: cd linux/ecosystem/electron-release-server && make build && make deploy ################################################################################## @@ -56,7 +56,7 @@ jobs: run: make - name: Build and Deploy vk2discord - run: cd llinux/ecosystem/vk2discord && make build && make deploy + run: cd linux/ecosystem/vk2discord && make build && make deploy ################################################################################## @@ -73,7 +73,7 @@ jobs: run: make - name: Build and Deploy qBittorrent - run: cd llinux/ecosystem/qbittorrent && make build && make deploy + run: cd linux/ecosystem/qbittorrent && make build && make deploy ################################################################################## @@ -90,7 +90,7 @@ jobs: run: make - name: Build and Deploy openTracker - run: cd llinux/ecosystem/opentracker && make build && make deploy + run: cd linux/ecosystem/opentracker && make build && make deploy ################################################################################## @@ -107,7 +107,7 @@ jobs: run: make - name: Build and Deploy reTracker - run: cd llinux/ecosystem/retracker && make build && make deploy + run: cd linux/ecosystem/retracker && make build && make deploy ################################################################################## @@ -124,7 +124,7 @@ jobs: run: make - name: Build and Deploy Torrust Tracker - run: cd llinux/ecosystem/torrust-tracker && make build && make deploy + run: cd linux/ecosystem/torrust-tracker && make build && make deploy ################################################################################## @@ -141,7 +141,7 @@ jobs: run: make - name: Build and Deploy Monero CLI - run: cd llinux/ecosystem/monero/monerod && make build && make deploy + run: cd linux/ecosystem/monero/monerod && make build && make deploy ################################################################################## @@ -158,7 +158,7 @@ jobs: run: make - name: Build and Deploy Monero p2pool - run: cd llinux/ecosystem/monero/p2pool && make build && make deploy + run: cd linux/ecosystem/monero/p2pool && make build && make deploy ################################################################################## - name: Cleanup diff --git a/CHANGELOG.md b/CHANGELOG.md index f87a90f95..04dc461ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,17 @@ ## Changelog ### 2022 +* `nov` + * added `php8.1`, `apache2 + php8.1` and `teamcity agent + php8.1` images + * build and ci fixes + * added `gitlab-runner` images + * updated `nextcloud`, `nginx` and `postgres` images * `oct` * just fixes * `sep` * added `debian 6` and `debian 7` iamges. to build them - add `GRUB_CMDLINE_LINUX_DEFAULT="quiet vsyscall=emulate"` if you have newest kernel! * added `p2pool` and `monerod` servers. * added new versions of `jira` - * added new versions of `confluence + * added new versions of `confluence` * added new versions of `bitbucket` * `aug`: * added basic support of perforce images. `p4p` already added. versions: `r16.2`, `r17.1`, `r17.2`, `r18.1`, `r18.2`, `r19.1`, `r19.2`, `r20.1`, `r20.2`, `r21.1`, `r21.2`, `r22.1`. diff --git a/linux/advanced/nextcloud/README.md b/linux/advanced/nextcloud/README.md index 01cb7d2ee..5fe88616c 100644 --- a/linux/advanced/nextcloud/README.md +++ b/linux/advanced/nextcloud/README.md @@ -2,4 +2,4 @@ All presented images avalible on our repo in docker hub. -* Nextcloud 14-20 images also avalible here. \ No newline at end of file +* Nextcloud 14-25 images also avalible here. \ No newline at end of file diff --git a/linux/advanced/nextcloud/patched/25/Dockerfile b/linux/advanced/nextcloud/patched/25/Dockerfile new file mode 100644 index 000000000..a291cf2b9 --- /dev/null +++ b/linux/advanced/nextcloud/patched/25/Dockerfile @@ -0,0 +1,8 @@ +FROM epicmorg/nextcloud:25 + +################################################################## +# thank u, mac users. rolling back normal ZipStreammer +################################################################## +RUN rm -frv /usr/src/nextcloud/lib/private/Streamer.php +ADD Streamer.php /usr/src/nextcloud/lib/private/ +RUN chown nobody:nogroup /usr/src/nextcloud/lib/private/Streamer.php diff --git a/linux/ecosystem/php/php8.1-p4-not-ready/Makefile b/linux/advanced/nextcloud/patched/25/Makefile similarity index 100% rename from linux/ecosystem/php/php8.1-p4-not-ready/Makefile rename to linux/advanced/nextcloud/patched/25/Makefile diff --git a/linux/advanced/nextcloud/patched/25/README.md b/linux/advanced/nextcloud/patched/25/README.md new file mode 100644 index 000000000..b6df71808 --- /dev/null +++ b/linux/advanced/nextcloud/patched/25/README.md @@ -0,0 +1,527 @@ +# What is Nextcloud? + +[![GitHub CI build status badge](https://github.com/nextcloud/docker/workflows/Images/badge.svg)](https://github.com/nextcloud/docker/actions?query=workflow%3AImages) +[![update.sh build status badge](https://github.com/nextcloud/docker/workflows/update.sh/badge.svg)](https://github.com/nextcloud/docker/actions?query=workflow%3Aupdate.sh) +[![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/nextcloud.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/nextcloud) +[![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/nextcloud.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/nextcloud) +[![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/nextcloud.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/nextcloud) +[![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/nextcloud.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/nextcloud) +[![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/nextcloud.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/nextcloud) +[![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/nextcloud.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/nextcloud) +[![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/nextcloud.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/nextcloud) +[![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/nextcloud.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/nextcloud) +[![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/nextcloud.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/nextcloud) + +A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms. + +![logo](https://cdn.rawgit.com/nextcloud/docker/80dd587d847b184ba95d7187a2a7a56ae4cbbb7b/logo.svg) + +# How to use this image +This image is designed to be used in a micro-service environment. There are two versions of the image you can choose from. + +The `apache` tag contains a full Nextcloud installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the `latest` tag and version tags that are not further specified. + +The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Nextcloud page. To use this image it must be combined with any webserver that can proxy the http requests to the FastCGI-port of the container. + +[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/nextcloud/docker/8db861d67f257a3e9ac1790ea06d4e2a7a193a6c/stack.yml) + +## Using the apache image +The apache image contains a webserver and exposes port 80. To start the container type: + +```console +$ docker run -d -p 8080:80 nextcloud +``` + +Now you can access Nextcloud at http://localhost:8080/ from your host system. + + +## Using the fpm image +To use the fpm image, you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases, you might want use another container or your host as proxy. +If you use your host you can address your Nextcloud container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). +In both cases you don't want to map the fpm port to your host. + +```console +$ docker run -d nextcloud:fpm +``` + +As the fastCGI-Process is not capable of serving static files (style sheets, images, ...), the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the [docker-compose section](#running-this-image-with-docker-compose). + +## Using an external database +By default, this container uses SQLite for data storage but the Nextcloud setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB or PostgreSQL database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. More info is in the docker-compose section. + +## Persistent data +The Nextcloud installation and all data beyond what lives in the database (file uploads, etc) are stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted. + +A named Docker volume or a mounted host directory should be used for upgrades and backups. To achieve this, you need one volume for your database container and one for Nextcloud. + +Nextcloud: +- `/var/www/html/` folder where all nextcloud data lives +```console +$ docker run -d \ +-v nextcloud:/var/www/html \ +nextcloud +``` + +Database: +- `/var/lib/mysql` MySQL / MariaDB Data +- `/var/lib/postgresql/data` PostgreSQL Data +```console +$ docker run -d \ +-v db:/var/lib/mysql \ +mariadb +``` + +If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps. +The `data`, `config` files are stored in respective subfolders inside `/var/www/html/`. The apps are split into core `apps` (which are shipped with Nextcloud and you don't need to take care of) and a `custom_apps` folder. If you use a custom theme it would go into the `themes` subfolder. + +Overview of the folders that can be mounted as volumes: + +- `/var/www/html` Main folder, needed for updating +- `/var/www/html/custom_apps` installed / modified apps +- `/var/www/html/config` local configuration +- `/var/www/html/data` the actual data of your Nextcloud +- `/var/www/html/themes/` theming/branding + +If you want to use named volumes for all of these, it would look like this: +```console +$ docker run -d \ +-v nextcloud:/var/www/html \ +-v apps:/var/www/html/custom_apps \ +-v config:/var/www/html/config \ +-v data:/var/www/html/data \ +-v theme:/var/www/html/themes/ \ +nextcloud +``` + +## Using the Nextcloud command-line interface +To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command): +```console +$ docker exec --user www-data CONTAINER_ID php occ +``` +or for docker-compose: +```console +$ docker-compose exec --user www-data app php occ +``` + +## Auto configuration via environment variables +The nextcloud image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable auto configuration, set your database connection via the following environment variables. ONLY use one database type! + +__SQLite__: +- `SQLITE_DATABASE` Name of the database using sqlite + +__MYSQL/MariaDB__: +- `MYSQL_DATABASE` Name of the database using mysql / mariadb. +- `MYSQL_USER` Username for the database using mysql / mariadb. +- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. +- `MYSQL_HOST` Hostname of the database server using mysql / mariadb. + +__PostgreSQL__: +- `POSTGRES_DB` Name of the database using postgres. +- `POSTGRES_USER` Username for the database using postgres. +- `POSTGRES_PASSWORD` Password for the database user using postgres. +- `POSTGRES_HOST` Hostname of the database server using postgres. + +If you set any values, they will not be asked in the install page on first run. With a complete configuration by using all variables for your database type, you can additionally configure your Nextcloud instance by setting admin user and password (only works if you set both): + +- `NEXTCLOUD_ADMIN_USER` Name of the Nextcloud admin user. +- `NEXTCLOUD_ADMIN_PASSWORD` Password for the Nextcloud admin user. + +If you want, you can set the data directory, otherwise default value will be used. + +- `NEXTCLOUD_DATA_DIR` (default: _/var/www/html/data_) Configures the data directory where nextcloud stores all files from the users. + +One or more trusted domains can be set through environment variable, too. They will be added to the configuration after install. + +- `NEXTCLOUD_TRUSTED_DOMAINS` (not set by default) Optional space-separated list of domains + +The install and update script is only triggered when a default command is used (`apache-foreground` or `php-fpm`). If you use a custom command you have to enable the install / update with + +- `NEXTCLOUD_UPDATE` (default: _0_) + +If you want to use Redis you have to create a separate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container, pass in the following parameters: + +- `REDIS_HOST` (not set by default) Name of Redis container +- `REDIS_HOST_PORT` (default: _6379_) Optional port for Redis, only use for external Redis servers that run on non-standard ports. +- `REDIS_HOST_PASSWORD` (not set by default) Redis password + +The use of Redis is recommended to prevent file locking problems. See the examples for further instructions. + +To use an external SMTP server, you have to provide the connection details. To configure Nextcloud to use SMTP add: + +- `SMTP_HOST` (not set by default): The hostname of the SMTP server. +- `SMTP_SECURE` (empty by default): Set to `ssl` to use SSL, or `tls` to use STARTTLS. +- `SMTP_PORT` (default: `465` for SSL and `25` for non-secure connections): Optional port for the SMTP connection. Use `587` for an alternative port for STARTTLS. +- `SMTP_AUTHTYPE` (default: `LOGIN`): The method used for authentication. Use `PLAIN` if no authentication is required. +- `SMTP_NAME` (empty by default): The username for the authentication. +- `SMTP_PASSWORD` (empty by default): The password for the authentication. +- `MAIL_FROM_ADDRESS` (not set by default): Use this address for the 'from' field in the emails sent by Nextcloud. +- `MAIL_DOMAIN` (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed. + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP. + +To use an external S3 compatible object store as primary storage, set the following variables: +- `OBJECTSTORE_S3_HOST`: The hostname of the object storage server +- `OBJECTSTORE_S3_BUCKET`: The name of the bucket that Nextcloud should store the data in +- `OBJECTSTORE_S3_KEY`: AWS style access key +- `OBJECTSTORE_S3_SECRET`: AWS style secret access key +- `OBJECTSTORE_S3_PORT`: The port that the object storage server is being served over +- `OBJECTSTORE_S3_SSL` (default: `true`): Whether or not SSL/TLS should be used to communicate with object storage server +- `OBJECTSTORE_S3_REGION`: The region that the S3 bucket resides in. +- `OBJECTSTORE_S3_USEPATH_STYLE` (default: `false`): Not required for AWS S3 + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3) for more information. + +To use an external OpenStack Swift object store as primary storage, set the following variables: +- `OBJECTSTORE_SWIFT_URL`: The Swift identity (Keystone) endpoint +- `OBJECTSTORE_SWIFT_AUTOCREATE` (default: `false`): Whether or not Nextcloud should automatically create the Swift container +- `OBJECTSTORE_SWIFT_USER_NAME`: Swift username +- `OBJECTSTORE_SWIFT_USER_PASSWORD`: Swift user password +- `OBJECTSTORE_SWIFT_USER_DOMAIN` (default: `Default`): Swift user domain +- `OBJECTSTORE_SWIFT_PROJECT_NAME`: OpenStack project name +- `OBJECTSTORE_SWIFT_PROJECT_DOMAIN` (default: `Default`): OpenStack project domain +- `OBJECTSTORE_SWIFT_SERVICE_NAME` (default: `swift`): Swift service name +- `OBJECTSTORE_SWIFT_SERVICE_REGION`: Swift endpoint region +- `OBJECTSTORE_SWIFT_CONTAINER_NAME`: Swift container (bucket) that Nextcloud should store the data in + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#openstack-swift) for more information. + + +## Using the apache image behind a reverse proxy and auto configure server host and protocol + +The apache image will replace the remote addr (ip address visible to Nextcloud) with the ip address from `X-Real-IP` if the request is coming from a proxy in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 by default. If you want Nextcloud to pick up the server host (`HTTP_X_FORWARDED_HOST`), protocol (`HTTP_X_FORWARDED_PROTO`) and client ip (`HTTP_X_FORWARDED_FOR`) from a trusted proxy disable rewrite ip and the reverse proxies ip address to `TRUSTED_PROXIES`. + +- `APACHE_DISABLE_REWRITE_IP` (not set by default): Set to 1 to disable rewrite ip. + +- `TRUSTED_PROXIES` (empty by default): A space-separated list of trusted proxies. CIDR notation is supported for IPv4. + +If the `TRUSTED_PROXIES` approach does not work for you, try using fixed values for overwrite parameters. + +- `OVERWRITEHOST` (empty by default): Set the hostname of the proxy. Can also specify a port. +- `OVERWRITEPROTOCOL` (empty by default): Set the protocol of the proxy, http or https. +- `OVERWRITEWEBROOT` (empty by default): Set the absolute path of the proxy. +- `OVERWRITECONDADDR` (empty by default): Regex to overwrite the values dependent on the remote address. + +Check the [Nexcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html) for more details. + +Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together. + +# Running this image with docker-compose +The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for. + +At first, make sure you have chosen the right base image (fpm or apache) and added features you wanted (see below). In every case, you would want to add a database container and docker volumes to get easy access to your persistent data. When you want to have your server reachable from the internet, adding HTTPS-encryption is mandatory! See below for more information. + +## Base version - apache +This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy. + +Make sure to pass in values for `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` variables before you run this setup. + +```yaml +version: '2' + +volumes: + nextcloud: + db: + +services: + db: + image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD= + - MYSQL_PASSWORD= + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + + app: + image: nextcloud + ports: + - 8080:80 + links: + - db + volumes: + - nextcloud:/var/www/html + restart: always + +``` + +Then run `docker-compose up -d`, now you can access Nextcloud at http://localhost:8080/ from your host system. + +## Base version - FPM +When using the FPM image, you need another container that acts as web server on port 80 and proxies the requests to the Nextcloud container. In this example a simple nginx container is combined with the Nextcloud-fpm image and a MariaDB database container. The data is stored in docker volumes. The nginx container also needs access to static files from your Nextcloud installation. It gets access to all the volumes mounted to Nextcloud via the `volumes_from` option.The configuration for nginx is stored in the configuration file `nginx.conf`, that is mounted into the container. An example can be found in the examples section [here](https://github.com/nextcloud/docker/tree/master/.examples). + +As this setup does **not include encryption**, it should be run behind a proxy. + +Make sure to pass in values for `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` variables before you run this setup. + +```yaml +version: '2' + +volumes: + nextcloud: + db: + +services: + db: + image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD= + - MYSQL_PASSWORD= + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + + app: + image: nextcloud:fpm + links: + - db + volumes: + - nextcloud:/var/www/html + restart: always + + web: + image: nginx + ports: + - 8080:80 + links: + - app + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + volumes_from: + - app + restart: always +``` + +Then run `docker-compose up -d`, now you can access Nextcloud at http://localhost:8080/ from your host system. + +# Docker Secrets +As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/ files. For example: +```yaml +version: '3.2' + +services: + db: + image: postgres + restart: always + volumes: + - db:/var/lib/postgresql/data + environment: + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + secrets: + - postgres_db + - postgres_password + - postgres_user + + app: + image: nextcloud + restart: always + ports: + - 8080:80 + volumes: + - nextcloud:/var/www/html + environment: + - POSTGRES_HOST=db + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password + - NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user + depends_on: + - db + secrets: + - nextcloud_admin_password + - nextcloud_admin_user + - postgres_db + - postgres_password + - postgres_user + +volumes: + db: + nextcloud: + +secrets: + nextcloud_admin_password: + file: ./nextcloud_admin_password.txt # put admin password to this file + nextcloud_admin_user: + file: ./nextcloud_admin_user.txt # put admin username to this file + postgres_db: + file: ./postgres_db.txt # put postgresql db name to this file + postgres_password: + file: ./postgres_password.txt # put postgresql password to this file + postgres_user: + file: ./postgres_user.txt # put postgresql username to this file +``` + +Currently, this is only supported for `NEXTCLOUD_ADMIN_PASSWORD`, `NEXTCLOUD_ADMIN_USER`, `MYSQL_DB`, `MYSQL_PASSWORD`, `MYSQL_USER`, `POSTGRES_DB`, `POSTGRES_PASSWORD`, `POSTGRES_USER`. + +# Make your Nextcloud available from the internet +Until here, your Nextcloud is just available from you docker host. If you want your Nextcloud available from the internet adding SSL encryption is mandatory. + +## HTTPS - SSL encryption +There are many different possibilities to introduce encryption depending on your setup. + +We recommend using a reverse proxy in front of our Nextcloud installation. Your Nextcloud will only be reachable through the proxy, which encrypts all traffic to the clients. You can mount your manually generated certificates to the proxy or use a fully automated solution which generates and renews the certificates for you. + +In our [examples](https://github.com/nextcloud/docker/tree/master/.examples) section we have an example for a fully automated setup using a reverse proxy, a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling, database and Nextcloud. It uses the popular [nginx-proxy](https://github.com/jwilder/nginx-proxy) and [docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers. Please check the according documentations before using this setup. + +# First use +When you first access your Nextcloud, the setup wizard will appear and ask you to choose an administrator account username, password and the database connection. For the database use `db` as host and `nextcloud` as table and user name. Also enter the password you chose in your `docker-compose.yml` file. + +# Update to a newer version +Updating the Nextcloud container is done by pulling the new image, throwing away the old container and starting the new one. + +**It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.** + +Since all data is stored in volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process. Don't forget to add all the volumes to your new container, so it works as expected. + +```console +$ docker pull nextcloud +$ docker stop +$ docker rm +$ docker run -d nextcloud +``` +Beware that you have to run the same command with the options that you used to initially start your Nextcloud. That includes volumes, port mapping. + +When using docker-compose your compose file takes care of your configuration, so you just have to run: + +```console +$ docker-compose pull +$ docker-compose up -d +``` + + +# Adding Features +A lot of people want to use additional functionality inside their Nextcloud installation. If the image does not include the packages you need, you can easily build your own image on top of it. +Start your derived image with the `FROM` statement and add whatever you like. + +```yaml +FROM nextcloud:apache + +RUN ... + +``` +The [examples folder](https://github.com/nextcloud/docker/blob/master/.examples) gives a few examples on how to add certain functionalities, like including the cron job, smb-support or imap-authentication. + +If you use your own Dockerfile, you need to configure your docker-compose file accordingly. Switch out the `image` option with `build`. You have to specify the path to your Dockerfile. (in the example it's in the same directory next to the docker-compose file) + +```yaml + app: + build: . + links: + - db + volumes: + - data:/var/www/html/data + - config:/var/www/html/config + - apps:/var/www/html/apps + restart: always +``` + +If you intend to use another command to run the image, make sure that you set `NEXTCLOUD_UPDATE=1` in your Dockerfile. Otherwise the installation and update will not work. + +```yaml +FROM nextcloud:apache + +... + +ENV NEXTCLOUD_UPDATE=1 + +CMD ["/usr/bin/supervisord"] +``` + + +**Updating** your own derived image is also very simple. When a new version of the Nextcloud image is available run: + +```console +docker build -t your-name --pull . +docker run -d your-name +``` + +or for docker-compose: +```console +docker-compose build --pull +docker-compose up -d +``` + +The `--pull` option tells docker to look for new versions of the base image. Then the build instructions inside your `Dockerfile` are run on top of the new image. + +# Migrating an existing installation +You're already using Nextcloud and want to switch to docker? Great! Here are some things to look out for: + +1. Define your whole Nextcloud infrastructure in a `docker-compose` file and run it with `docker-compose up -d` to get the base installation, volumes and database. Work from there. +2. Restore your database from a mysqldump (nextcloud\_db\_1 is the name of your db container) + - To import from a MySQL dump use the following commands + ```console + docker cp ./database.dmp nextcloud_db_1:/dmp + docker-compose exec db sh -c "mysql -u USER -pPASSWORD nextcloud < /dmp" + docker-compose exec db rm /dmp + ``` + - To import from a PostgreSQL dump use to following commands + ```console + docker cp ./database.dmp nextcloud_db_1:/dmp + docker-compose exec db sh -c "psql -U USER --set ON_ERROR_STOP=on nextcloud < /dmp" + docker-compose exec db rm /dmp + ``` +3. Edit your config.php + 1. Set database connection + - In case of MySQL database + ```php + 'dbhost' => 'db:3306', + ``` + - In case of PostgreSQL database + ```php + 'dbhost' => 'db:5432', + ``` + 2. Make sure you have no configuration for the `apps_paths`. Delete lines like these + ```diff + - "apps_paths" => array ( + - 0 => array ( + - "path" => OC::$SERVERROOT."/apps", + - "url" => "/apps", + - "writable" => true, + - ), + ``` + 3. Make sure to have the `apps` directory non writable and the `custom_apps` directory writable + ```php + 'apps_paths' => array ( + 0 => array ( + 'path' => '/var/www/html/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => array ( + 'path' => '/var/www/html/custom_apps', + 'url' => '/custom_apps', + 'writable' => true, + ), + ), + ``` + 4. Make sure your data directory is set to /var/www/html/data + ```php + 'datadirectory' => '/var/www/html/data', + ``` + + +4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container): +```console +docker cp ./data/ nextcloud_app_1:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/data +docker cp ./theming/ nextcloud_app_1:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/theming +docker cp ./config/config.php nextcloud_app_1:/var/www/html/config +docker-compose exec app chown -R www-data:www-data /var/www/html/config +``` +5. Copy only the custom apps you use (or simply redownload them from the web interface): +```console +docker cp ./custom_apps/ nextcloud_data:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps +``` + +# Questions / Issues +If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/nextcloud/docker) and write an issue. diff --git a/linux/advanced/nextcloud/patched/25/Streamer.php b/linux/advanced/nextcloud/patched/25/Streamer.php new file mode 100644 index 000000000..02a7719e4 --- /dev/null +++ b/linux/advanced/nextcloud/patched/25/Streamer.php @@ -0,0 +1,190 @@ + + * @author Daniel Calviño Sánchez + * @author Joas Schilling + * @author Roeland Jago Douma + * @author Thomas Müller + * @author Victor Dubiniuk + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OC; + +use OC\Files\Filesystem; +use OCP\Files\File; +use OCP\Files\Folder; +use OCP\Files\InvalidPathException; +use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; +use OCP\IRequest; +use ownCloud\TarStreamer\TarStreamer; +use ZipStreamer\ZipStreamer; + +class Streamer { + // array of regexp. Matching user agents will get tar instead of zip + private $preferTarFor = [ '/macintosh|mac os x/i' ]; + + // streamer instance + private $streamerInstance; + + /** + * Streamer constructor. + * + * @param IRequest $request + * @param int $size The size of the files in bytes + * @param int $numberOfFiles The number of files (and directories) that will + * be included in the streamed file + */ + public function __construct(IRequest $request, $size, int $numberOfFiles){ + + /** + * zip32 constraints for a basic (without compression, volumes nor + * encryption) zip file according to the Zip specification: + * - No file size is larger than 4 bytes (file size < 4294967296); see + * 4.4.9 uncompressed size + * - The size of all files plus their local headers is not larger than + * 4 bytes; see 4.4.16 relative offset of local header and 4.4.24 + * offset of start of central directory with respect to the starting + * disk number + * - The total number of entries (files and directories) in the zip file + * is not larger than 2 bytes (number of entries < 65536); see 4.4.22 + * total number of entries in the central dir + * - The size of the central directory is not larger than 4 bytes; see + * 4.4.23 size of the central directory + * + * Due to all that, zip32 is used if the size is below 4GB and there are + * less than 65536 files; the margin between 4*1000^3 and 4*1024^3 + * should give enough room for the extra zip metadata. Technically, it + * would still be possible to create an invalid zip32 file (for example, + * a zip file from files smaller than 4GB with a central directory + * larger than 4GiB), but it should not happen in the real world. + */ + if ($size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) { + $this->streamerInstance = new ZipStreamer(['zip64' => true]); + } else if ($request->isUserAgent($this->preferTarFor)) { + $this->streamerInstance = new TarStreamer(); + } else { + $this->streamerInstance = new ZipStreamer(['zip64' => PHP_INT_SIZE !== 4]); + } + } + + /** + * Send HTTP headers + * @param string $name + */ + public function sendHeaders($name){ + $extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar'; + $fullName = $name . $extension; + $this->streamerInstance->sendHeaders($fullName); + } + + /** + * Stream directory recursively + * + * @throws NotFoundException + * @throws NotPermittedException + * @throws InvalidPathException + */ + public function addDirRecursive(string $dir, string $internalDir = ''): void { + $dirname = basename($dir); + $rootDir = $internalDir . $dirname; + if (!empty($rootDir)) { + $this->streamerInstance->addEmptyDir($rootDir); + } + $internalDir .= $dirname . '/'; + // prevent absolute dirs + $internalDir = ltrim($internalDir, '/'); + + $userFolder = \OC::$server->getRootFolder()->get(Filesystem::getRoot()); + /** @var Folder $dirNode */ + $dirNode = $userFolder->get($dir); + $files = $dirNode->getDirectoryListing(); + + foreach($files as $file) { + if($file instanceof File) { + try { + $fh = $file->fopen('r'); + } catch (NotPermittedException $e) { + continue; + } + $this->addFileFromStream( + $fh, + $internalDir . $file->getName(), + $file->getSize(), + $file->getMTime() + ); + fclose($fh); + } elseif ($file instanceof Folder) { + if($file->isReadable()) { + $this->addDirRecursive($dir . '/' . $file->getName(), $internalDir); + } + } + } + } + + /** + * Add a file to the archive at the specified location and file name. + * + * @param string $stream Stream to read data from + * @param string $internalName Filepath and name to be used in the archive. + * @param int $size Filesize + * @param int|bool $time File mtime as int, or false + * @return bool $success + */ + public function addFileFromStream($stream, $internalName, $size, $time) { + $options = []; + if ($time) { + $options = [ + 'timestamp' => $time + ]; + } + + if ($this->streamerInstance instanceof ZipStreamer) { + return $this->streamerInstance->addFileFromStream($stream, $internalName, $options); + } else { + return $this->streamerInstance->addFileFromStream($stream, $internalName, $size, $options); + } + } + + /** + * Add an empty directory entry to the archive. + * + * @param string $dirName Directory Path and name to be added to the archive. + * @return bool $success + */ + public function addEmptyDir($dirName){ + return $this->streamerInstance->addEmptyDir($dirName); + } + + /** + * Close the archive. + * A closed archive can no longer have new files added to it. After + * closing, the file is completely written to the output stream. + * @return bool $success + */ + public function finalize(){ + return $this->streamerInstance->finalize(); + } +} diff --git a/linux/advanced/nextcloud/patched/25/docker-compose.yml b/linux/advanced/nextcloud/patched/25/docker-compose.yml new file mode 100644 index 000000000..9a9036ca2 --- /dev/null +++ b/linux/advanced/nextcloud/patched/25/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.9' +services: + app: + image: "epicmorg/nextcloud:25-patched" + build: + context: . diff --git a/linux/advanced/nextcloud/pure/25/Dockerfile b/linux/advanced/nextcloud/pure/25/Dockerfile new file mode 100644 index 000000000..7e11e0eb5 --- /dev/null +++ b/linux/advanced/nextcloud/pure/25/Dockerfile @@ -0,0 +1,68 @@ +FROM nextcloud:25 +ENV DEBIAN_FRONTEND noninteractive + +################################################################## +# adding normal sources list +################################################################## +RUN rm /etc/apt/sources.list +COPY sources.list /etc/apt/sources.list + +################################################################## +# adding some utils +################################################################## +RUN apt update -y && \ + apt dist-upgrade -y && \ + apt install -y --allow-unauthenticated \ + apt-transport-https \ + curl \ + ca-certificates \ + ghostscript \ + nload \ + htop \ + mc \ + nano \ + sudo \ + imagemagick \ + imagemagick-common \ + sqlite3 \ + smbclient \ + libsmbclient \ + wget \ + net-tools \ + iputils-ping + + +################################################################## +# installing php repo + smbclient +################################################################## +RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg +RUN sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list' +RUN apt update -y && \ + apt install -y --allow-unauthenticated \ + libsmbclient-dev \ + libmagickwand-dev \ + libmagickcore-dev \ + libc-client-dev \ + libkrb5-dev \ + libsqlite3-dev \ + libssl-dev + +RUN pecl install inotify && \ + docker-php-ext-enable inotify + +RUN pecl install smbclient && \ + docker-php-ext-enable smbclient + +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \ + docker-php-ext-install imap && \ + docker-php-ext-enable imap + +RUN docker-php-ext-install fileinfo bz2 intl ftp pdo_sqlite && \ + docker-php-ext-enable fileinfo bz2 intl ftp pdo_sqlite + +################################################################## +# smb fix +################################################################## +RUN rm -frv /etc/samba/smb.conf /usr/share/samba/smb.conf +ADD smb.conf /etc/samba/ +ADD smb.conf /usr/share/samba/ diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/Makefile b/linux/advanced/nextcloud/pure/25/Makefile similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/Makefile rename to linux/advanced/nextcloud/pure/25/Makefile diff --git a/linux/advanced/nextcloud/pure/25/README.md b/linux/advanced/nextcloud/pure/25/README.md new file mode 100644 index 000000000..b6df71808 --- /dev/null +++ b/linux/advanced/nextcloud/pure/25/README.md @@ -0,0 +1,527 @@ +# What is Nextcloud? + +[![GitHub CI build status badge](https://github.com/nextcloud/docker/workflows/Images/badge.svg)](https://github.com/nextcloud/docker/actions?query=workflow%3AImages) +[![update.sh build status badge](https://github.com/nextcloud/docker/workflows/update.sh/badge.svg)](https://github.com/nextcloud/docker/actions?query=workflow%3Aupdate.sh) +[![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/nextcloud.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/nextcloud) +[![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/nextcloud.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/nextcloud) +[![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/nextcloud.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/nextcloud) +[![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/nextcloud.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/nextcloud) +[![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/nextcloud.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/nextcloud) +[![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/nextcloud.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/nextcloud) +[![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/nextcloud.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/nextcloud) +[![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/nextcloud.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/nextcloud) +[![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/nextcloud.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/nextcloud) + +A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms. + +![logo](https://cdn.rawgit.com/nextcloud/docker/80dd587d847b184ba95d7187a2a7a56ae4cbbb7b/logo.svg) + +# How to use this image +This image is designed to be used in a micro-service environment. There are two versions of the image you can choose from. + +The `apache` tag contains a full Nextcloud installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the `latest` tag and version tags that are not further specified. + +The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Nextcloud page. To use this image it must be combined with any webserver that can proxy the http requests to the FastCGI-port of the container. + +[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/nextcloud/docker/8db861d67f257a3e9ac1790ea06d4e2a7a193a6c/stack.yml) + +## Using the apache image +The apache image contains a webserver and exposes port 80. To start the container type: + +```console +$ docker run -d -p 8080:80 nextcloud +``` + +Now you can access Nextcloud at http://localhost:8080/ from your host system. + + +## Using the fpm image +To use the fpm image, you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases, you might want use another container or your host as proxy. +If you use your host you can address your Nextcloud container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). +In both cases you don't want to map the fpm port to your host. + +```console +$ docker run -d nextcloud:fpm +``` + +As the fastCGI-Process is not capable of serving static files (style sheets, images, ...), the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the [docker-compose section](#running-this-image-with-docker-compose). + +## Using an external database +By default, this container uses SQLite for data storage but the Nextcloud setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB or PostgreSQL database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. More info is in the docker-compose section. + +## Persistent data +The Nextcloud installation and all data beyond what lives in the database (file uploads, etc) are stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted. + +A named Docker volume or a mounted host directory should be used for upgrades and backups. To achieve this, you need one volume for your database container and one for Nextcloud. + +Nextcloud: +- `/var/www/html/` folder where all nextcloud data lives +```console +$ docker run -d \ +-v nextcloud:/var/www/html \ +nextcloud +``` + +Database: +- `/var/lib/mysql` MySQL / MariaDB Data +- `/var/lib/postgresql/data` PostgreSQL Data +```console +$ docker run -d \ +-v db:/var/lib/mysql \ +mariadb +``` + +If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps. +The `data`, `config` files are stored in respective subfolders inside `/var/www/html/`. The apps are split into core `apps` (which are shipped with Nextcloud and you don't need to take care of) and a `custom_apps` folder. If you use a custom theme it would go into the `themes` subfolder. + +Overview of the folders that can be mounted as volumes: + +- `/var/www/html` Main folder, needed for updating +- `/var/www/html/custom_apps` installed / modified apps +- `/var/www/html/config` local configuration +- `/var/www/html/data` the actual data of your Nextcloud +- `/var/www/html/themes/` theming/branding + +If you want to use named volumes for all of these, it would look like this: +```console +$ docker run -d \ +-v nextcloud:/var/www/html \ +-v apps:/var/www/html/custom_apps \ +-v config:/var/www/html/config \ +-v data:/var/www/html/data \ +-v theme:/var/www/html/themes/ \ +nextcloud +``` + +## Using the Nextcloud command-line interface +To use the [Nextcloud command-line interface](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) (aka. `occ` command): +```console +$ docker exec --user www-data CONTAINER_ID php occ +``` +or for docker-compose: +```console +$ docker-compose exec --user www-data app php occ +``` + +## Auto configuration via environment variables +The nextcloud image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable auto configuration, set your database connection via the following environment variables. ONLY use one database type! + +__SQLite__: +- `SQLITE_DATABASE` Name of the database using sqlite + +__MYSQL/MariaDB__: +- `MYSQL_DATABASE` Name of the database using mysql / mariadb. +- `MYSQL_USER` Username for the database using mysql / mariadb. +- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. +- `MYSQL_HOST` Hostname of the database server using mysql / mariadb. + +__PostgreSQL__: +- `POSTGRES_DB` Name of the database using postgres. +- `POSTGRES_USER` Username for the database using postgres. +- `POSTGRES_PASSWORD` Password for the database user using postgres. +- `POSTGRES_HOST` Hostname of the database server using postgres. + +If you set any values, they will not be asked in the install page on first run. With a complete configuration by using all variables for your database type, you can additionally configure your Nextcloud instance by setting admin user and password (only works if you set both): + +- `NEXTCLOUD_ADMIN_USER` Name of the Nextcloud admin user. +- `NEXTCLOUD_ADMIN_PASSWORD` Password for the Nextcloud admin user. + +If you want, you can set the data directory, otherwise default value will be used. + +- `NEXTCLOUD_DATA_DIR` (default: _/var/www/html/data_) Configures the data directory where nextcloud stores all files from the users. + +One or more trusted domains can be set through environment variable, too. They will be added to the configuration after install. + +- `NEXTCLOUD_TRUSTED_DOMAINS` (not set by default) Optional space-separated list of domains + +The install and update script is only triggered when a default command is used (`apache-foreground` or `php-fpm`). If you use a custom command you have to enable the install / update with + +- `NEXTCLOUD_UPDATE` (default: _0_) + +If you want to use Redis you have to create a separate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container, pass in the following parameters: + +- `REDIS_HOST` (not set by default) Name of Redis container +- `REDIS_HOST_PORT` (default: _6379_) Optional port for Redis, only use for external Redis servers that run on non-standard ports. +- `REDIS_HOST_PASSWORD` (not set by default) Redis password + +The use of Redis is recommended to prevent file locking problems. See the examples for further instructions. + +To use an external SMTP server, you have to provide the connection details. To configure Nextcloud to use SMTP add: + +- `SMTP_HOST` (not set by default): The hostname of the SMTP server. +- `SMTP_SECURE` (empty by default): Set to `ssl` to use SSL, or `tls` to use STARTTLS. +- `SMTP_PORT` (default: `465` for SSL and `25` for non-secure connections): Optional port for the SMTP connection. Use `587` for an alternative port for STARTTLS. +- `SMTP_AUTHTYPE` (default: `LOGIN`): The method used for authentication. Use `PLAIN` if no authentication is required. +- `SMTP_NAME` (empty by default): The username for the authentication. +- `SMTP_PASSWORD` (empty by default): The password for the authentication. +- `MAIL_FROM_ADDRESS` (not set by default): Use this address for the 'from' field in the emails sent by Nextcloud. +- `MAIL_DOMAIN` (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed. + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP. + +To use an external S3 compatible object store as primary storage, set the following variables: +- `OBJECTSTORE_S3_HOST`: The hostname of the object storage server +- `OBJECTSTORE_S3_BUCKET`: The name of the bucket that Nextcloud should store the data in +- `OBJECTSTORE_S3_KEY`: AWS style access key +- `OBJECTSTORE_S3_SECRET`: AWS style secret access key +- `OBJECTSTORE_S3_PORT`: The port that the object storage server is being served over +- `OBJECTSTORE_S3_SSL` (default: `true`): Whether or not SSL/TLS should be used to communicate with object storage server +- `OBJECTSTORE_S3_REGION`: The region that the S3 bucket resides in. +- `OBJECTSTORE_S3_USEPATH_STYLE` (default: `false`): Not required for AWS S3 + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3) for more information. + +To use an external OpenStack Swift object store as primary storage, set the following variables: +- `OBJECTSTORE_SWIFT_URL`: The Swift identity (Keystone) endpoint +- `OBJECTSTORE_SWIFT_AUTOCREATE` (default: `false`): Whether or not Nextcloud should automatically create the Swift container +- `OBJECTSTORE_SWIFT_USER_NAME`: Swift username +- `OBJECTSTORE_SWIFT_USER_PASSWORD`: Swift user password +- `OBJECTSTORE_SWIFT_USER_DOMAIN` (default: `Default`): Swift user domain +- `OBJECTSTORE_SWIFT_PROJECT_NAME`: OpenStack project name +- `OBJECTSTORE_SWIFT_PROJECT_DOMAIN` (default: `Default`): OpenStack project domain +- `OBJECTSTORE_SWIFT_SERVICE_NAME` (default: `swift`): Swift service name +- `OBJECTSTORE_SWIFT_SERVICE_REGION`: Swift endpoint region +- `OBJECTSTORE_SWIFT_CONTAINER_NAME`: Swift container (bucket) that Nextcloud should store the data in + +Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#openstack-swift) for more information. + + +## Using the apache image behind a reverse proxy and auto configure server host and protocol + +The apache image will replace the remote addr (ip address visible to Nextcloud) with the ip address from `X-Real-IP` if the request is coming from a proxy in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 by default. If you want Nextcloud to pick up the server host (`HTTP_X_FORWARDED_HOST`), protocol (`HTTP_X_FORWARDED_PROTO`) and client ip (`HTTP_X_FORWARDED_FOR`) from a trusted proxy disable rewrite ip and the reverse proxies ip address to `TRUSTED_PROXIES`. + +- `APACHE_DISABLE_REWRITE_IP` (not set by default): Set to 1 to disable rewrite ip. + +- `TRUSTED_PROXIES` (empty by default): A space-separated list of trusted proxies. CIDR notation is supported for IPv4. + +If the `TRUSTED_PROXIES` approach does not work for you, try using fixed values for overwrite parameters. + +- `OVERWRITEHOST` (empty by default): Set the hostname of the proxy. Can also specify a port. +- `OVERWRITEPROTOCOL` (empty by default): Set the protocol of the proxy, http or https. +- `OVERWRITEWEBROOT` (empty by default): Set the absolute path of the proxy. +- `OVERWRITECONDADDR` (empty by default): Regex to overwrite the values dependent on the remote address. + +Check the [Nexcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html) for more details. + +Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together. + +# Running this image with docker-compose +The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for. + +At first, make sure you have chosen the right base image (fpm or apache) and added features you wanted (see below). In every case, you would want to add a database container and docker volumes to get easy access to your persistent data. When you want to have your server reachable from the internet, adding HTTPS-encryption is mandatory! See below for more information. + +## Base version - apache +This version will use the apache image and add a mariaDB container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy. + +Make sure to pass in values for `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` variables before you run this setup. + +```yaml +version: '2' + +volumes: + nextcloud: + db: + +services: + db: + image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD= + - MYSQL_PASSWORD= + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + + app: + image: nextcloud + ports: + - 8080:80 + links: + - db + volumes: + - nextcloud:/var/www/html + restart: always + +``` + +Then run `docker-compose up -d`, now you can access Nextcloud at http://localhost:8080/ from your host system. + +## Base version - FPM +When using the FPM image, you need another container that acts as web server on port 80 and proxies the requests to the Nextcloud container. In this example a simple nginx container is combined with the Nextcloud-fpm image and a MariaDB database container. The data is stored in docker volumes. The nginx container also needs access to static files from your Nextcloud installation. It gets access to all the volumes mounted to Nextcloud via the `volumes_from` option.The configuration for nginx is stored in the configuration file `nginx.conf`, that is mounted into the container. An example can be found in the examples section [here](https://github.com/nextcloud/docker/tree/master/.examples). + +As this setup does **not include encryption**, it should be run behind a proxy. + +Make sure to pass in values for `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD` variables before you run this setup. + +```yaml +version: '2' + +volumes: + nextcloud: + db: + +services: + db: + image: mariadb + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + restart: always + volumes: + - db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD= + - MYSQL_PASSWORD= + - MYSQL_DATABASE=nextcloud + - MYSQL_USER=nextcloud + + app: + image: nextcloud:fpm + links: + - db + volumes: + - nextcloud:/var/www/html + restart: always + + web: + image: nginx + ports: + - 8080:80 + links: + - app + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + volumes_from: + - app + restart: always +``` + +Then run `docker-compose up -d`, now you can access Nextcloud at http://localhost:8080/ from your host system. + +# Docker Secrets +As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/ files. For example: +```yaml +version: '3.2' + +services: + db: + image: postgres + restart: always + volumes: + - db:/var/lib/postgresql/data + environment: + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + secrets: + - postgres_db + - postgres_password + - postgres_user + + app: + image: nextcloud + restart: always + ports: + - 8080:80 + volumes: + - nextcloud:/var/www/html + environment: + - POSTGRES_HOST=db + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password + - NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user + depends_on: + - db + secrets: + - nextcloud_admin_password + - nextcloud_admin_user + - postgres_db + - postgres_password + - postgres_user + +volumes: + db: + nextcloud: + +secrets: + nextcloud_admin_password: + file: ./nextcloud_admin_password.txt # put admin password to this file + nextcloud_admin_user: + file: ./nextcloud_admin_user.txt # put admin username to this file + postgres_db: + file: ./postgres_db.txt # put postgresql db name to this file + postgres_password: + file: ./postgres_password.txt # put postgresql password to this file + postgres_user: + file: ./postgres_user.txt # put postgresql username to this file +``` + +Currently, this is only supported for `NEXTCLOUD_ADMIN_PASSWORD`, `NEXTCLOUD_ADMIN_USER`, `MYSQL_DB`, `MYSQL_PASSWORD`, `MYSQL_USER`, `POSTGRES_DB`, `POSTGRES_PASSWORD`, `POSTGRES_USER`. + +# Make your Nextcloud available from the internet +Until here, your Nextcloud is just available from you docker host. If you want your Nextcloud available from the internet adding SSL encryption is mandatory. + +## HTTPS - SSL encryption +There are many different possibilities to introduce encryption depending on your setup. + +We recommend using a reverse proxy in front of our Nextcloud installation. Your Nextcloud will only be reachable through the proxy, which encrypts all traffic to the clients. You can mount your manually generated certificates to the proxy or use a fully automated solution which generates and renews the certificates for you. + +In our [examples](https://github.com/nextcloud/docker/tree/master/.examples) section we have an example for a fully automated setup using a reverse proxy, a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling, database and Nextcloud. It uses the popular [nginx-proxy](https://github.com/jwilder/nginx-proxy) and [docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers. Please check the according documentations before using this setup. + +# First use +When you first access your Nextcloud, the setup wizard will appear and ask you to choose an administrator account username, password and the database connection. For the database use `db` as host and `nextcloud` as table and user name. Also enter the password you chose in your `docker-compose.yml` file. + +# Update to a newer version +Updating the Nextcloud container is done by pulling the new image, throwing away the old container and starting the new one. + +**It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.** + +Since all data is stored in volumes, nothing gets lost. The startup script will check for the version in your volume and the installed docker version. If it finds a mismatch, it automatically starts the upgrade process. Don't forget to add all the volumes to your new container, so it works as expected. + +```console +$ docker pull nextcloud +$ docker stop +$ docker rm +$ docker run -d nextcloud +``` +Beware that you have to run the same command with the options that you used to initially start your Nextcloud. That includes volumes, port mapping. + +When using docker-compose your compose file takes care of your configuration, so you just have to run: + +```console +$ docker-compose pull +$ docker-compose up -d +``` + + +# Adding Features +A lot of people want to use additional functionality inside their Nextcloud installation. If the image does not include the packages you need, you can easily build your own image on top of it. +Start your derived image with the `FROM` statement and add whatever you like. + +```yaml +FROM nextcloud:apache + +RUN ... + +``` +The [examples folder](https://github.com/nextcloud/docker/blob/master/.examples) gives a few examples on how to add certain functionalities, like including the cron job, smb-support or imap-authentication. + +If you use your own Dockerfile, you need to configure your docker-compose file accordingly. Switch out the `image` option with `build`. You have to specify the path to your Dockerfile. (in the example it's in the same directory next to the docker-compose file) + +```yaml + app: + build: . + links: + - db + volumes: + - data:/var/www/html/data + - config:/var/www/html/config + - apps:/var/www/html/apps + restart: always +``` + +If you intend to use another command to run the image, make sure that you set `NEXTCLOUD_UPDATE=1` in your Dockerfile. Otherwise the installation and update will not work. + +```yaml +FROM nextcloud:apache + +... + +ENV NEXTCLOUD_UPDATE=1 + +CMD ["/usr/bin/supervisord"] +``` + + +**Updating** your own derived image is also very simple. When a new version of the Nextcloud image is available run: + +```console +docker build -t your-name --pull . +docker run -d your-name +``` + +or for docker-compose: +```console +docker-compose build --pull +docker-compose up -d +``` + +The `--pull` option tells docker to look for new versions of the base image. Then the build instructions inside your `Dockerfile` are run on top of the new image. + +# Migrating an existing installation +You're already using Nextcloud and want to switch to docker? Great! Here are some things to look out for: + +1. Define your whole Nextcloud infrastructure in a `docker-compose` file and run it with `docker-compose up -d` to get the base installation, volumes and database. Work from there. +2. Restore your database from a mysqldump (nextcloud\_db\_1 is the name of your db container) + - To import from a MySQL dump use the following commands + ```console + docker cp ./database.dmp nextcloud_db_1:/dmp + docker-compose exec db sh -c "mysql -u USER -pPASSWORD nextcloud < /dmp" + docker-compose exec db rm /dmp + ``` + - To import from a PostgreSQL dump use to following commands + ```console + docker cp ./database.dmp nextcloud_db_1:/dmp + docker-compose exec db sh -c "psql -U USER --set ON_ERROR_STOP=on nextcloud < /dmp" + docker-compose exec db rm /dmp + ``` +3. Edit your config.php + 1. Set database connection + - In case of MySQL database + ```php + 'dbhost' => 'db:3306', + ``` + - In case of PostgreSQL database + ```php + 'dbhost' => 'db:5432', + ``` + 2. Make sure you have no configuration for the `apps_paths`. Delete lines like these + ```diff + - "apps_paths" => array ( + - 0 => array ( + - "path" => OC::$SERVERROOT."/apps", + - "url" => "/apps", + - "writable" => true, + - ), + ``` + 3. Make sure to have the `apps` directory non writable and the `custom_apps` directory writable + ```php + 'apps_paths' => array ( + 0 => array ( + 'path' => '/var/www/html/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => array ( + 'path' => '/var/www/html/custom_apps', + 'url' => '/custom_apps', + 'writable' => true, + ), + ), + ``` + 4. Make sure your data directory is set to /var/www/html/data + ```php + 'datadirectory' => '/var/www/html/data', + ``` + + +4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container): +```console +docker cp ./data/ nextcloud_app_1:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/data +docker cp ./theming/ nextcloud_app_1:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/theming +docker cp ./config/config.php nextcloud_app_1:/var/www/html/config +docker-compose exec app chown -R www-data:www-data /var/www/html/config +``` +5. Copy only the custom apps you use (or simply redownload them from the web interface): +```console +docker cp ./custom_apps/ nextcloud_data:/var/www/html/ +docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps +``` + +# Questions / Issues +If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/nextcloud/docker) and write an issue. diff --git a/linux/advanced/nextcloud/pure/25/docker-compose.yml b/linux/advanced/nextcloud/pure/25/docker-compose.yml new file mode 100644 index 000000000..67fb90d05 --- /dev/null +++ b/linux/advanced/nextcloud/pure/25/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.9' +services: + app: + image: "epicmorg/nextcloud:25" + build: + context: . diff --git a/linux/advanced/nextcloud/pure/25/smb.conf b/linux/advanced/nextcloud/pure/25/smb.conf new file mode 100644 index 000000000..9346a22f4 --- /dev/null +++ b/linux/advanced/nextcloud/pure/25/smb.conf @@ -0,0 +1,239 @@ +# +# Sample configuration file for the Samba suite for Debian GNU/Linux. +# +# +# This is the main Samba configuration file. You should read the +# smb.conf(5) manual page in order to understand the options listed +# here. Samba has a huge number of configurable options most of which +# are not shown in this example +# +# Some options that are often worth tuning have been included as +# commented-out examples in this file. +# - When such options are commented with ";", the proposed setting +# differs from the default Samba behaviour +# - When commented with "#", the proposed setting is the default +# behaviour of Samba but the option is considered important +# enough to be mentioned here +# +# NOTE: Whenever you modify this file you should run the command +# "testparm" to check that you have not made any basic syntactic +# errors. + +#======================= Global Settings ======================= + +[global] +client min protocol = SMB2 +client max protocol = SMB3 + + +## Browsing/Identification ### + +# Change this to the workgroup/NT-domain name your Samba server will part of + workgroup = WORKGROUP + +#### Networking #### + +# The specific set of interfaces / networks to bind to +# This can be either the interface name or an IP address/netmask; +# interface names are normally preferred +; interfaces = 127.0.0.0/8 eth0 + +# Only bind to the named interfaces and/or networks; you must use the +# 'interfaces' option above to use this. +# It is recommended that you enable this feature if your Samba machine is +# not protected by a firewall or is a firewall itself. However, this +# option cannot handle dynamic or non-broadcast interfaces correctly. +; bind interfaces only = yes + + + +#### Debugging/Accounting #### + +# This tells Samba to use a separate log file for each machine +# that connects + log file = /var/log/samba/log.%m + +# Cap the size of the individual log files (in KiB). + max log size = 1000 + +# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}. +# Append syslog@1 if you want important messages to be sent to syslog too. + logging = file + +# Do something sensible when Samba crashes: mail the admin a backtrace + panic action = /usr/share/samba/panic-action %d + + +####### Authentication ####### + +# Server role. Defines in which mode Samba will operate. Possible +# values are "standalone server", "member server", "classic primary +# domain controller", "classic backup domain controller", "active +# directory domain controller". +# +# Most people will want "standalone server" or "member server". +# Running as "active directory domain controller" will require first +# running "samba-tool domain provision" to wipe databases and create a +# new domain. + server role = standalone server + + obey pam restrictions = yes + +# This boolean parameter controls whether Samba attempts to sync the Unix +# password with the SMB password when the encrypted SMB password in the +# passdb is changed. + unix password sync = yes + +# For Unix password sync to work on a Debian GNU/Linux system, the following +# parameters must be set (thanks to Ian Kahan < for +# sending the correct chat script for the passwd program in Debian Sarge). + passwd program = /usr/bin/passwd %u + passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . + +# This boolean controls whether PAM will be used for password changes +# when requested by an SMB client instead of the program listed in +# 'passwd program'. The default is 'no'. + pam password change = yes + +# This option controls how unsuccessful authentication attempts are mapped +# to anonymous connections + map to guest = bad user + +########## Domains ########### + +# +# The following settings only takes effect if 'server role = primary +# classic domain controller', 'server role = backup domain controller' +# or 'domain logons' is set +# + +# It specifies the location of the user's +# profile directory from the client point of view) The following +# required a [profiles] share to be setup on the samba server (see +# below) +; logon path = \\%N\profiles\%U +# Another common choice is storing the profile in the user's home directory +# (this is Samba's default) +# logon path = \\%N\%U\profile + +# The following setting only takes effect if 'domain logons' is set +# It specifies the location of a user's home directory (from the client +# point of view) +; logon drive = H: +# logon home = \\%N\%U + +# The following setting only takes effect if 'domain logons' is set +# It specifies the script to run during logon. The script must be stored +# in the [netlogon] share +# NOTE: Must be store in 'DOS' file format convention +; logon script = logon.cmd + +# This allows Unix users to be created on the domain controller via the SAMR +# RPC pipe. The example command creates a user account with a disabled Unix +# password; please adapt to your needs +; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u + +# This allows machine accounts to be created on the domain controller via the +# SAMR RPC pipe. +# The following assumes a "machines" group exists on the system +; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u + +# This allows Unix groups to be created on the domain controller via the SAMR +# RPC pipe. +; add group script = /usr/sbin/addgroup --force-badname %g + +############ Misc ############ + +# Using the following line enables you to customise your configuration +# on a per machine basis. The %m gets replaced with the netbios name +# of the machine that is connecting +; include = /home/samba/etc/smb.conf.%m + +# Some defaults for winbind (make sure you're not using the ranges +# for something else.) +; idmap config * : backend = tdb +; idmap config * : range = 3000-7999 +; idmap config YOURDOMAINHERE : backend = tdb +; idmap config YOURDOMAINHERE : range = 100000-999999 +; template shell = /bin/bash + +# Setup usershare options to enable non-root users to share folders +# with the net usershare command. + +# Maximum number of usershare. 0 means that usershare is disabled. +# usershare max shares = 100 + +# Allow users who've been granted usershare privileges to create +# public shares, not just authenticated ones + usershare allow guests = yes + +#======================= Share Definitions ======================= + +[homes] + comment = Home Directories + browseable = no + +# By default, the home directories are exported read-only. Change the +# next parameter to 'no' if you want to be able to write to them. + read only = yes + +# File creation mask is set to 0700 for security reasons. If you want to +# create files with group=rw permissions, set next parameter to 0775. + create mask = 0700 + +# Directory creation mask is set to 0700 for security reasons. If you want to +# create dirs. with group=rw permissions, set next parameter to 0775. + directory mask = 0700 + +# By default, \\server\username shares can be connected to by anyone +# with access to the samba server. +# The following parameter makes sure that only "username" can connect +# to \\server\username +# This might need tweaking when using external authentication schemes + valid users = %S + +# Un-comment the following and create the netlogon directory for Domain Logons +# (you need to configure Samba to act as a domain controller too.) +;[netlogon] +; comment = Network Logon Service +; path = /home/samba/netlogon +; guest ok = yes +; read only = yes + +# Un-comment the following and create the profiles directory to store +# users profiles (see the "logon path" option above) +# (you need to configure Samba to act as a domain controller too.) +# The path below should be writable by all users so that their +# profile directory may be created the first time they log on +;[profiles] +; comment = Users profiles +; path = /home/samba/profiles +; guest ok = no +; browseable = no +; create mask = 0600 +; directory mask = 0700 + +[printers] + comment = All Printers + browseable = no + path = /var/spool/samba + printable = yes + guest ok = no + read only = yes + create mask = 0700 + +# Windows clients look for this share name as a source of downloadable +# printer drivers +[print$] + comment = Printer Drivers + path = /var/lib/samba/printers + browseable = yes + read only = yes + guest ok = no +# Uncomment to allow remote administration of Windows print drivers. +# You may need to replace 'lpadmin' with the name of the group your +# admin users are members of. +# Please note that you also need to set appropriate Unix permissions +# to the drivers directory for these users to have write rights in it +; write list = root, @lpadmin + diff --git a/linux/advanced/nextcloud/pure/25/sources.list b/linux/advanced/nextcloud/pure/25/sources.list new file mode 100644 index 000000000..508f1b71c --- /dev/null +++ b/linux/advanced/nextcloud/pure/25/sources.list @@ -0,0 +1,28 @@ +#main +deb http://httpredir.debian.org/debian/ bullseye main contrib non-free +deb-src http://httpredir.debian.org/debian/ bullseye main contrib non-free + +deb http://httpredir.debian.org/debian/ bullseye-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ bullseye-updates main contrib non-free + +deb http://httpredir.debian.org/debian/ bullseye-backports main contrib non-free +deb-src http://httpredir.debian.org/debian/ bullseye-backports main contrib non-free + +deb http://httpredir.debian.org/debian/ bullseye-backports-sloppy main contrib non-free +deb-src http://httpredir.debian.org/debian/ bullseye-backports-sloppy main contrib non-free + +deb http://httpredir.debian.org/debian/ bullseye-proposed-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ bullseye-proposed-updates main contrib non-free + +#security +deb http://httpredir.debian.org/debian-security/ bullseye-security main contrib non-free +deb-src http://httpredir.debian.org/debian-security/ bullseye-security main contrib non-free + +deb http://httpredir.debian.org/debian-security/ bullseye-security/updates main contrib non-free +deb-src http://httpredir.debian.org/debian-security/ bullseye-security/updates main contrib non-free + +##multimedia +#deb http://httpredir.debian.org/debian-multimedia/ bullseye main non-free +#deb-src http://httpredir.debian.org/debian-multimedia/ bullseye main non-free +#deb http://httpredir.debian.org/debian-multimedia/ bullseye-backports main +#deb-src http://httpredir.debian.org/debian-multimedia/ bullseye-backports main diff --git a/linux/advanced/vscode-server/devops/Dockerfile b/linux/advanced/vscode-server/devops/Dockerfile index 52dd15ba4..f0e4b4fa9 100644 --- a/linux/advanced/vscode-server/devops/Dockerfile +++ b/linux/advanced/vscode-server/devops/Dockerfile @@ -76,11 +76,11 @@ RUN apt-get update && \ libcrypto++-dev \ libbz2-dev \ libvpx-dev \ - libvpx6 \ +# libvpx6 \ libc6 \ libgssapi-krb5-2 \ - liblttng-ust0 \ - libssl1.1 \ +# liblttng-ust0 \ +# libssl1.1 \ libstdc++6 \ zlib1g \ tcl diff --git a/linux/ecosystem/apache2/php8.0/Dockerfile b/linux/ecosystem/apache2/php8.0/Dockerfile index 6f76767bd..353295aac 100644 --- a/linux/ecosystem/apache2/php8.0/Dockerfile +++ b/linux/ecosystem/apache2/php8.0/Dockerfile @@ -54,13 +54,6 @@ RUN apt-get update && \ ################################################################## RUN echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf -################################################################## -# Installing IOnCube addon -################################################################## -#RUN echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/apache2/php.ini && \ -# php -m && \ -# php -v - ################################################################## # Installing timezonedb addon ################################################################## diff --git a/linux/ecosystem/apache2/php8.1/Dockerfile b/linux/ecosystem/apache2/php8.1/Dockerfile new file mode 100644 index 000000000..3d5c68e92 --- /dev/null +++ b/linux/ecosystem/apache2/php8.1/Dockerfile @@ -0,0 +1,111 @@ +FROM epicmorg/php:php8.1 +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +ARG PHP_MODULE_VER=20210902 +ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} +ARG PHP_VER=8.1 +ARG PHP_DIR=/etc/php/${PHP_VER} +ARG P4_PHP_INI=${PHP_DIR}/mods-available/perfroce.ini +ARG SMB_PHP_INI=${PHP_DIR}/mods-available/smbclient.ini + +################################################################## +# Installing Apache2 +################################################################## +#installing apache2 repo +RUN wget -O /etc/apt/trusted.gpg.d/apache2.gpg https://packages.sury.org/apache2/apt.gpg +RUN sh -c 'echo "deb https://packages.sury.org/apache2/ buster main" > /etc/apt/sources.list.d/apache2.list' + +#Install base packages +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + apache2 \ + apache2-utils \ + libapache2-mod-php8.1 \ + libapache2-mod-webauth \ + libapache2-mod-xforward \ + libapache2-mod-security2 && \ + a2enmod \ + php8.1 \ + rewrite \ + ldap \ + heartmonitor \ + auth_basic \ + authnz_ldap \ + headers \ + heartbeat \ + slotmem_shm \ + lua \ + mime \ + status \ + xml2enc \ + xforward \ + remoteip \ + filter \ + dav \ + dav_fs \ + alias && \ + ln -sf /etc/ssl/dhparam.pem /etc/apache2/dhparam.pem && \ + php -m && \ + php -v + +################################################################## +# LDAP Fix +################################################################## +RUN echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf + +################################################################## +# Installing IOnCube addon +################################################################## +RUN echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_8.1.so" >> ${PHP_DIR}/apache2/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing timezonedb addon +################################################################## +RUN echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/apache2/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing imagic addon +################################################################## +RUN echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/apache2/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing smbclient addon +################################################################## +RUN ln -sf ${SMB_PHP_INI} ${PHP_DIR}/apache2/conf.d/smbclient.ini && \ + php -m && \ + php -v + +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb && \ + rm -rfv /tmp/deb/* && \ + rm -rfv /tmp/ioncube/* && \ + rm -rfv /tmp/composer-setup.php && \ + rm -rfv /tmp/ioncube.tar.gz + +#healthcheck. good practice +HEALTHCHECK --interval=2m --timeout=3s CMD curl -f http://localhost:80/ || exit 1 + +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh +RUN chown -Rf www-data:www-data /var/www + +#Final config +VOLUME ["/var/www"] +WORKDIR /var/www/ +EXPOSE 80 443 + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] +CMD ["docker-entrypoint.sh"] diff --git a/linux/ecosystem/apache2/php8.1/Makefile b/linux/ecosystem/apache2/php8.1/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/apache2/php8.1/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/apache2/php8.1/README.md b/linux/ecosystem/apache2/php8.1/README.md new file mode 100644 index 000000000..86a34d4b1 --- /dev/null +++ b/linux/ecosystem/apache2/php8.1/README.md @@ -0,0 +1,32 @@ +# Compose example + +```yml +version: '3.7' +services: + websites: + image: epicmorg/websites +# depends_on: +# - mysql +# - memcached + restart: unless-stopped + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone +# - /etc/letsencrypt:/etc/letsencrypt + - www:/var/www + - apache2:/etc/apache2 + - php:/etc/php + restart: unless-stopped +# extra_hosts: +# - "example.com:192.168.0.11" + tmpfs: + - /tmp + - /var/lib/php/sessions +volumes: + www: + external: true + apache2: + external: true + php: + external: true +``` diff --git a/linux/ecosystem/apache2/php8.1/docker-compose.yml b/linux/ecosystem/apache2/php8.1/docker-compose.yml new file mode 100644 index 000000000..d55e093ff --- /dev/null +++ b/linux/ecosystem/apache2/php8.1/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.9' +services: + app: + image: "epicmorg/apache2:php8.1" + build: + context: . diff --git a/linux/ecosystem/apache2/php8.1/docker-entrypoint.sh b/linux/ecosystem/apache2/php8.1/docker-entrypoint.sh new file mode 100755 index 000000000..b421b8648 --- /dev/null +++ b/linux/ecosystem/apache2/php8.1/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [[ -z "${FIX_WWW_DATA}" ]]; then + echo "[apache2] env FIX_WWW_DATA is not set. Skipping..." +elif [ "${FIX_WWW_DATA}" == "false" ]; then + echo "[apache2] env FIX_WWW_DATA is set to false. Skipping..." +elif [ "${FIX_WWW_DATA}" == "true" ]; then + echo "[apache2] Changing permissions for /var/www path. Dont worry, please wait." + chown www-data:www-data /var/www -R + echo "[apache2] Done" +else + echo "[apache2] env FIX_WWW_DATA is set to strange value. Skipping..." +fi + +echo "[apache2] Starting up" +source /etc/apache2/envvars +tail -F /var/log/apache2/* & +exec apache2 -D FOREGROUND diff --git a/linux/ecosystem/nginx/1.21.6/main/.env b/linux/ecosystem/nginx/1.21.6/main/.env new file mode 100644 index 000000000..dd46749d4 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/.env @@ -0,0 +1,2 @@ +NGINX_VERSION=1.21.6 +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz diff --git a/linux/ecosystem/nginx/1.21.6/main/Dockerfile b/linux/ecosystem/nginx/1.21.6/main/Dockerfile new file mode 100644 index 000000000..00b9a25a6 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/Dockerfile @@ -0,0 +1,244 @@ +################################################################## +# Set Global ARG to build process +################################################################## +ARG NGINX_VERSION + +################################################################## +# Start build process +################################################################## +FROM epicmorg/debian:bullseye-develop AS builder +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +################################################################## +# ARGuments +################################################################## +ENV BuildDocker true +ARG BUILDS_DIR=/builds +ARG SRC_DIR=${BUILDS_DIR}/src +ARG EXPORT_DIR=${BUILDS_DIR}/export +ARG PRE_DIR=${BUILDS_DIR}/pre +ARG NGINX_SRC_DIR=${SRC_DIR}/nginx +ARG NGINX_VERSION +ARG NGINX_DOWNLOAD_URL +ARG LUAJIT_INC=/usr/local/include/luajit-2.1 +ARG LUAJIT_LIB=/usr/local/lib + +################################################################## +# Files and folders +################################################################## +RUN mkdir -p ${PRE_DIR} ${NGINX_SRC_DIR} /usr/lib/nginx +ADD pre/luajit2-description-pak ${PRE_DIR} +ADD pre/nginx-description-pak ${PRE_DIR} +ADD pre/ip2location-description-pak ${PRE_DIR} + +################################################################## +# IP2Location support for prod nginx module +################################################################## +RUN cd ${SRC_DIR} && \ + git clone https://github.com/chrislim2888/IP2Location-C-Library.git ip2 && \ + cp -fv ${PRE_DIR}/ip2location-description-pak ${SRC_DIR}/ip2/description-pak && \ + cd ${SRC_DIR}/ip2 && \ ls -las && \ + autoreconf -i -v --force && \ + aclocal && \ + automake --gnu --add-missing && \ + autoconf && \ + autoreconf -i -v --force && \ + ./configure && \ + ls -las && \ + make clean && \ + make && \ + make -C data convert && \ + make check && \ + ls -las && \ + fakeroot checkinstall -D --pakdir=${EXPORT_DIR} --maintainer="EpicMorg, developer@epicm.org" --pkgname=ip2-custom --conflicts=ip2 --install=yes -y && \ + ln -s /usr/local/lib/libIP2Location.so /usr/lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /usr/lib/libIP2Location.so.1 && \ + ln -s /usr/local/lib/libIP2Location.so.2 /usr/lib/libIP2Location.so.2 && \ + ln -s /usr/local/lib/libIP2Location.so /lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /lib/libIP2Location.so.1 && \ + ln -s /usr/local/lib/libIP2Location.so.2 /lib/libIP2Location.so.2 && \ + dpkg --force-all -i ${EXPORT_DIR}/*.deb + +################################################################## +# luaJIT 2 support for prod nginx module +################################################################## +RUN cd ${SRC_DIR} && \ + git clone https://github.com/openresty/luajit2.git luajit2 && \ + cp -fv ${PRE_DIR}/luajit2-description-pak ${SRC_DIR}/luajit2/description-pak && \ + cd ${SRC_DIR}/luajit2 && \ + make && \ + make install && \ + fakeroot checkinstall -D --pakdir=${EXPORT_DIR} --maintainer="EpicMorg, developer@epicm.org" --pkgname=luajit2-custom --conflicts=luajit2 --install=no -y + +################################################################## +# nginx preparing +################################################################## +RUN wget -qO - ${NGINX_DOWNLOAD_URL} | tar -zxv --strip-components=1 -C ${NGINX_SRC_DIR} && \ + cd ${NGINX_SRC_DIR} && \ + git clone https://github.com/openresty/headers-more-nginx-module.git http-headers-more-filter && \ + git clone https://github.com/sto/ngx_http_auth_pam_module.git http-auth-pam && \ + git clone https://github.com/arut/nginx-dav-ext-module.git http-dav-ext && \ + git clone https://github.com/openresty/echo-nginx-module.git http-echo && \ + git clone https://github.com/aperezdc/ngx-fancyindex.git http-fancyindex && \ + git clone https://github.com/slact/nchan.git nchan && \ + git clone https://github.com/masterzen/nginx-upload-progress-module.git http-uploadprogress && \ + git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module http-subs-filter && \ + git clone https://github.com/grahamedgecombe/nginx-ct.git ssl-ct && \ + git clone https://github.com/stnoonan/spnego-http-auth-nginx-module.git spnego-http-auth-nginx-module && \ + git clone https://github.com/leev/ngx_http_geoip2_module http-geoip2 && \ + git clone https://github.com/flavioribeiro/nginx-audio-track-for-hls-module.git nginx-audio-track-for-hls-module && \ + git clone https://github.com/chrislim2888/ip2location-nginx.git ip2location-nginx && \ + git clone https://github.com/kaltura/nginx-vod-module.git nginx-vod-module && \ + git clone https://github.com/vozlt/nginx-module-vts.git nginx-module-vts && \ + git clone https://github.com/evanmiller/mod_zip.git mod-zip && \ + git clone https://github.com/alibaba/nginx-http-user-agent.git nginx-http-user-agent && \ + git clone https://github.com/youzee/nginx-unzip-module.git nginx-unzip-module && \ + git clone https://github.com/vladbondarenko/ngx_webp.git ngx-webp && \ + git clone https://github.com/openresty/xss-nginx-module.git xss-nginx-module && \ + git clone https://github.com/openresty/set-misc-nginx-module.git set-misc-nginx-module && \ + git clone https://github.com/arut/nginx-rtmp-module.git rtmp && \ + git clone https://github.com/kvspb/nginx-auth-ldap.git http-auth-ldap && \ + git clone https://github.com/simplresty/ngx_devel_kit.git http-ndk && \ + git clone https://github.com/chrislim2888/IP2Location-C-Library.git ip2location-c-7.0.0 && \ + git clone https://github.com/itoffshore/nginx-upstream-fair.git http-upstream-fair && \ + git clone https://github.com/yaoweibin/nginx_upstream_check_module.git nginx-upstream-check-module && \ + git clone https://github.com/openresty/lua-nginx-module http-lua + +################################################################## +# nginx compilling +################################################################## +RUN cd ${NGINX_SRC_DIR} && \ + ./configure \ + --sbin-path=/usr/sbin/nginx \ + --prefix=/usr/share/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=/var/log/nginx/error.log \ + --lock-path=/var/lock/nginx.lock \ + --pid-path=/run/nginx.pid \ + --modules-path=/usr/lib/nginx/modules \ + --http-client-body-temp-path=/var/lib/nginx/body \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --http-scgi-temp-path=/var/lib/nginx/scgi \ + --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ + --with-cc-opt='-I/usr/local/include/luajit-2.1 -g -O2 -lz -fstack-protector-strong -Wformat -Wno-error=date-time -Wno-error=implicit-fallthrough= -Wno-error=cast-function-type -Wno-error=format-security -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-result -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ + --with-ld-opt='-Wl,-z,relro -Wl,-z,now -lz -fPIC -L/usr/local/lib' \ + --with-file-aio \ + --with-compat \ + --with-debug \ + --with-threads \ + --with-pcre-jit \ + --with-http_ssl_module \ + --with-http_stub_status_module \ + --with-http_realip_module \ + --with-http_auth_request_module \ + --with-http_v2_module \ + --with-http_dav_module \ + --with-http_slice_module \ + --with-http_addition_module \ + --with-http_flv_module \ + --with-http_geoip_module=dynamic \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_image_filter_module=dynamic \ + --with-http_mp4_module \ + --with-http_perl_module=dynamic \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_sub_module \ + --with-http_xslt_module=dynamic \ + --with-mail=dynamic \ + --with-mail_ssl_module \ + --with-stream=dynamic \ + --with-stream_ssl_module \ + --with-stream_ssl_preread_module \ + --add-dynamic-module=http-headers-more-filter \ + --add-dynamic-module=http-auth-pam \ + --add-dynamic-module=http-dav-ext \ + --add-dynamic-module=http-ndk \ + --add-dynamic-module=http-echo \ + --add-dynamic-module=http-fancyindex \ + --add-dynamic-module=nchan \ + --add-dynamic-module=http-uploadprogress \ + --add-dynamic-module=http-subs-filter \ + --add-dynamic-module=ssl-ct \ + --add-dynamic-module=http-geoip2 \ + --add-dynamic-module=spnego-http-auth-nginx-module \ + --add-dynamic-module=http-auth-ldap \ +# --add-dynamic-module=nginx-audio-track-for-hls-module \ + --add-dynamic-module=ip2location-nginx \ + --add-dynamic-module=nginx-vod-module \ +# --add-dynamic-module=nginx-module-vts \ + --add-dynamic-module=mod-zip \ + --add-dynamic-module=nginx-http-user-agent \ + --add-dynamic-module=nginx-unzip-module \ + --add-dynamic-module=ngx-webp \ + --add-dynamic-module=set-misc-nginx-module \ + --add-dynamic-module=rtmp \ + --add-dynamic-module=http-upstream-fair \ + --add-dynamic-module=nginx-upstream-check-module \ + --add-dynamic-module=http-lua && \ + cp -fv ${PRE_DIR}/nginx-description-pak ${NGINX_SRC_DIR}/description-pak && \ + fakeroot checkinstall -D --pakdir=/builds/export --maintainer="EpicMorg, developer@epicm.org" --pkgname=nginx-custom --install=no -y && \ + apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb + +################################################################## +################################################################## +################################################################## + +FROM epicmorg/debian:bullseye +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +################################################################## +# LDAP Fix +################################################################## +RUN echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf + +################################################################## +# Installing nginx from deb +################################################################## +ADD pre/ngninx.pre.tar.gz / +COPY --from=builder /builds/export /tmp/deb +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + geoip-database \ + geoip-bin \ + libgeoip1 \ + libmaxminddb0 \ + libgd3 \ + libxslt1.1 && \ + dpkg --force-all -i /tmp/deb/*.deb && \ + ln -s /usr/local/lib/libIP2Location.so /usr/lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /usr/lib/libIP2Location.so.1 && \ + ln -s /usr/local/lib/libIP2Location.so.2 /usr/lib/libIP2Location.so.2 && \ + ln -s /usr/local/lib/libIP2Location.so.3 /usr/lib/libIP2Location.so.3 && \ + ln -s /usr/local/lib/libIP2Location.so.4 /usr/lib/libIP2Location.so.4 && \ + ln -s /usr/local/lib/libIP2Location.so.5 /usr/lib/libIP2Location.so.5 && \ + ln -s /usr/local/lib/libIP2Location.so /lib/libIP2Location.so && \ + ln -s /usr/local/lib/libIP2Location.so.1 /lib/libIP2Location.so.1 && \ + ln -s /usr/local/lib/libIP2Location.so.2 /lib/libIP2Location.so.2 && \ + ln -s /usr/local/lib/libIP2Location.so.3 /lib/libIP2Location.so.3 && \ + ln -s /usr/local/lib/libIP2Location.so.4 /lib/libIP2Location.so.4 && \ + ln -s /usr/local/lib/libIP2Location.so.5 /lib/libIP2Location.so.5 && \ + ln -sf /dev/stdout /var/log/nginx/access.log && \ + ln -sf /dev/stderr /var/log/nginx/error.log && \ + ln -sf /etc/ssl/dhparam.pem /etc/nginx/dhparam.pem && \ + apt clean -y && \ + apt autoclean -y && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/apt/archives/*.deb && \ + rm -rf /tmp/deb/* && \ + rm -rf /builds/* && \ + rm -rf /valve/* + +#Final config +VOLUME ["/var/cache/nginx"] +EXPOSE 80 443 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/linux/ecosystem/nginx/1.21.6/main/Makefile b/linux/ecosystem/nginx/1.21.6/main/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/nginx/1.21.6/main/README.md b/linux/ecosystem/nginx/1.21.6/main/README.md new file mode 100644 index 000000000..034784bc0 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/README.md @@ -0,0 +1,30 @@ +# Compose example + +```yml +version: '3.7' +services: + balancer: + image: epicmorg/balancer + restart: unless-stopped + ports: + - "0.0.0.0:80:80" + - "0.0.0.0:443:443" + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /etc/letsencrypt:/etc/letsencrypt + - nginx:/etc/nginx + - nginx-usr:/usr/share/nginx/html + - /var/lib/nginx +# extra_hosts: +# - "example.com:192.168.0.11" + depends_on: + - websites + tmpfs: + - /tmp +volumes: + nginx: + external: true + nginx-usr: + external: true +``` diff --git a/linux/ecosystem/nginx/1.21.6/main/docker-compose.yml b/linux/ecosystem/nginx/1.21.6/main/docker-compose.yml new file mode 100644 index 000000000..4d5d761fb --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.9' +services: + app: + image: "epicmorg/nginx:${NGINX_VERSION}" + build: + context: . + args: + NGINX_VERSION: ${NGINX_VERSION} + NGINX_DOWNLOAD_URL: ${NGINX_DOWNLOAD_URL} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/main/pre/ip2location-description-pak b/linux/ecosystem/nginx/1.21.6/main/pre/ip2location-description-pak new file mode 100644 index 000000000..e93eb7783 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/pre/ip2location-description-pak @@ -0,0 +1 @@ +Custom build of ip2location lib by EpicMorg. diff --git a/linux/ecosystem/nginx/1.21.6/main/pre/luajit2-description-pak b/linux/ecosystem/nginx/1.21.6/main/pre/luajit2-description-pak new file mode 100644 index 000000000..4305e8e88 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/pre/luajit2-description-pak @@ -0,0 +1 @@ +Custom build of luajit2 for Nginx module, by EpicMorg. diff --git a/linux/ecosystem/nginx/1.21.6/main/pre/nginx-description-pak b/linux/ecosystem/nginx/1.21.6/main/pre/nginx-description-pak new file mode 100644 index 000000000..b6c186ed8 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/main/pre/nginx-description-pak @@ -0,0 +1 @@ +Custom build of Nginx with some modules by EpicMorg. \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/main/pre/ngninx.pre.tar.gz b/linux/ecosystem/nginx/1.21.6/main/pre/ngninx.pre.tar.gz new file mode 100644 index 000000000..bf9c27351 Binary files /dev/null and b/linux/ecosystem/nginx/1.21.6/main/pre/ngninx.pre.tar.gz differ diff --git a/linux/ecosystem/nginx/1.21.6/php/.env b/linux/ecosystem/nginx/1.21.6/php/.env new file mode 100644 index 000000000..dd46749d4 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/php/.env @@ -0,0 +1,2 @@ +NGINX_VERSION=1.21.6 +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz diff --git a/linux/ecosystem/php/php8.1-p4-not-ready/Dockerfile b/linux/ecosystem/nginx/1.21.6/php/Dockerfile similarity index 62% rename from linux/ecosystem/php/php8.1-p4-not-ready/Dockerfile rename to linux/ecosystem/nginx/1.21.6/php/Dockerfile index 0df911310..3d928b4a0 100644 --- a/linux/ecosystem/php/php8.1-p4-not-ready/Dockerfile +++ b/linux/ecosystem/nginx/1.21.6/php/Dockerfile @@ -1,3 +1,11 @@ +################################################################## +# Set Global ARG to build process +################################################################## +ARG NGINX_VERSION + +################################################################## +# Start build process +################################################################## FROM epicmorg/debian:bullseye-develop AS builder LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" ARG DEBIAN_FRONTEND=noninteractive @@ -7,22 +15,20 @@ ARG DEBIAN_FRONTEND=noninteractive ################################################################## ENV BuildDocker true - ARG BUILDS_DIR=/builds ARG SRC_DIR=${BUILDS_DIR}/src ARG EXPORT_DIR=${BUILDS_DIR}/export ARG P4API_DIR=${SRC_DIR}/p4api ARG P4PHP_DIR=${SRC_DIR}/p4php -ARG PHP_VER=8.1 -ARG MAKE_DIR=${SRC_DIR}/p4php-${PHP_VER} -ARG P4API_VER=r21.1 +ARG MAKE_DIR=${SRC_DIR}/p4php-7.4 + +ARG P4API_VER=r20.1 ARG P4API_URL=http://filehost.perforce.com/perforce/${P4API_VER}/bin.linux26x86_64/p4api.tgz -ARG P4PHP_VER=r20.2 -ARG P4PHP_URL=http://filehost.perforce.com/perforce/${P4PHP_VER}/bin.tools/p4php.tgz +ARG P4PHP_VER=r20.1 +ARG P4PHP_URL=http://filehost.perforce.com/perforce/${P4PHP_VER}/bin.tools/p4php-php7.tgz -ARG PHP_MODULE_VER=20210902 -ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} +ARG PHP_MODULE_PATH=/usr/lib/php/20190902 ################################################################## # Files and folders @@ -30,21 +36,20 @@ ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} RUN mkdir -p ${BUILDS_DIR} ${SRC_DIR} ${EXPORT_DIR} ${MAKE_DIR} ${P4API_DIR} ${P4PHP_DIR} ################################################################## -# Installing PHP8 +# Installing PHP7 ################################################################## -RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ - sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' +#installing php repo #Install base packages RUN apt-get update && \ apt-get install -y --allow-unauthenticated \ libmemcached-dev \ smbclient libsmbclient libsmbclient-dev \ - php8.1 \ - php8.1-dev \ - php8.1-fpm \ - php8.1-cli \ - php8.1-cgi + php7.4 \ + php7.4-dev \ + php7.4-fpm \ + php7.4-cli \ + php7.4-cgi ################################################################## # preparing p4src @@ -74,6 +79,7 @@ RUN cd ${MAKE_DIR} && \ make install && \ cp ${PHP_MODULE_PATH}/perforce.so ${EXPORT_DIR} + ################################################################## # compilling smbclient ################################################################## @@ -84,79 +90,70 @@ RUN pecl install smbclient && \ ################################################################## ################################################################## -FROM epicmorg/debian:bullseye +FROM epicmorg/nginx:${NGINX_VERSION} LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" ARG DEBIAN_FRONTEND=noninteractive -ARG PHP_MODULE_VER=20210902 -ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} -ARG PHP_VER=8.1 +################################################################## +# Installing php fpm for nginx from deb +################################################################## +ARG PHP_MODULE_PATH=/usr/lib/php/20190902 +ARG PHP_VER=7.4 ARG PHP_DIR=/etc/php/${PHP_VER} ARG P4_PHP_INI=${PHP_DIR}/mods-available/perfroce.ini ARG SMB_PHP_INI=${PHP_DIR}/mods-available/smbclient.ini ################################################################## -# Installing PHP8 +# Installing PHP7 ################################################################## -RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ - sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' - +#Install base packages RUN apt-get update && \ apt-get install -y --allow-unauthenticated \ - libmemcached-dev \ - php8.1 \ - php8.1-dev \ - php8.1-fpm \ - php8.1-cli \ - php8.1-cgi \ + php7.4 \ + php7.4-dev \ + php7.4-fpm \ + php7.4-cli \ + php7.4-cgi \ php-pear \ - php8.1-gmp \ - php8.1-snmp \ - php8.1-ldap \ - php8.1-mail \ - php8.1-soap \ - php8.1-mysql \ - php8.1-memcached \ - php8.1-memcache \ - php8.1-igbinary \ - php8.1-interbase \ - php8.1-curl \ - php8.1-gd \ - php8.1-intl \ - php8.1-zip \ - php8.1-bcmath \ - php8.1-imap \ - php8.1-pspell \ - php8.1-sqlite3 \ - php8.1-pgsql \ - php8.1-tidy \ - php8.1-xmlrpc \ - php8.1-xml \ - php8.1-mbstring \ - php8.1-apcu \ - php8.1-common \ -# php8.1-json \ - php8.1-readline \ - php8.1-enchant \ - php8.1-ssh2 \ - php8.1-oauth \ - php8.1-gmagick \ - php8.1-gnupg \ - php8.1-redis \ + php7.4-gmp \ + php7.4-snmp \ + php7.4-ldap \ + php7.4-mail \ + php7.4-soap \ + php7.4-mysql \ + php7.4-memcached \ + php7.4-memcache \ + php7.4-igbinary \ + php7.4-interbase \ + php7.4-curl \ + php7.4-gd \ + php7.4-intl \ + php7.4-zip \ + php7.4-bcmath \ + php7.4-imap \ + php7.4-pspell \ + php7.4-sqlite3 \ + php7.4-tidy \ + php7.4-xmlrpc \ + php7.4-xml \ + php7.4-mbstring \ + php7.4-apcu \ + php7.4-common \ + php7.4-json \ + php7.4-readline \ + php7.4-enchant \ + php7.4-ssh2 \ + php7.4-oauth \ + php7.4-gmagick \ + php7.4-gnupg \ + php7.4-redis \ smbclient libsmbclient \ - php8.1-yaml \ -# php8.1-geoip \ +# php-smbclient \ + php7.4-yaml \ + php7.4-geoip \ sendmail && \ - ln -sf /etc/ssl/dhparam.pem /etc/php/dhparam.pem && \ - update-alternatives --set php /usr/bin/php8.1 && \ - pecl channel-update pecl.php.net && \ - php -m && \ - php -v - -################################################################## -# Enabling extensions -################################################################## -RUN phpenmod \ + update-alternatives --set php /usr/bin/php7.4 && \ + phpenmod \ snmp \ gmp \ calendar \ @@ -193,55 +190,27 @@ RUN phpenmod \ xmlwriter \ xsl \ yaml && \ - php -m && \ + ln -sf /etc/ssl/dhparam.pem /etc/php/dhparam.pem && \ php -v -################################################################## -# Installing timezonedb addon -################################################################## -RUN pecl install timezonedb && \ -# echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/apache2/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/cgi/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/cli/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/fpm/php.ini && \ - php -m && \ - php -v - -################################################################## -# Installing imagic addon -################################################################## -RUN apt-get update && \ - apt-get install -y --allow-unauthenticated \ - libmagickwand-dev \ - imagemagick && \ - pecl install imagick && \ -# echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/apache2/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/cgi/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/cli/php.ini && \ - echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/fpm/php.ini && \ - php -m && \ - php -v - -################################################################## -# not supported with php8 ################################################################## # Installing IOnCube addon -################################################################# -#ADD https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz /tmp/ioncube.tar.gz -#RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \ -# cp /tmp/ioncube/ioncube_loader_lin_7.4.so ${PHP_MODULE_PATH} && \ -## echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/apache2/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cgi/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cli/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/fpm/php.ini && \ -# php -m && \ -# php -v +################################################################## +ADD https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz /tmp/ioncube.tar.gz +RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \ + cp /tmp/ioncube/ioncube_loader_lin_7.4.so ${PHP_MODULE_PATH} && \ +# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/apache2/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cgi/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cli/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/fpm/php.ini && \ + php -m && \ + php -v ################################################################## # Installing P4 addon ################################################################## COPY --from=builder /builds/export/perforce.so ${PHP_MODULE_PATH} -RUN echo "extension = ${PHP_MODULE_PATH}/perforce.so" > ${P4_PHP_INI} && \ +RUN echo "extension=perforce.so" > ${P4_PHP_INI} && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/cgi/conf.d/perforce.ini && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/cli/conf.d/perforce.ini && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/fpm/conf.d/perforce.ini && \ @@ -252,13 +221,15 @@ RUN echo "extension = ${PHP_MODULE_PATH}/perforce.so" > ${P4_PHP_INI} && \ # Installing smbclient addon ################################################################## COPY --from=builder /builds/export/smbclient.so ${PHP_MODULE_PATH} -RUN echo "extension = ${PHP_MODULE_PATH}/smbclient.so" > ${SMB_PHP_INI} && \ +RUN echo "extension=smbclient.so" > ${SMB_PHP_INI} && \ ln -sf ${SMB_PHP_INI} ${PHP_DIR}/cgi/conf.d/smbclient.ini && \ ln -sf ${SMB_PHP_INI} ${PHP_DIR}/cli/conf.d/smbclient.ini && \ ln -sf ${SMB_PHP_INI} ${PHP_DIR}/fpm/conf.d/smbclient.ini && \ php -m && \ php -v + + ################################################################## # Installing Composer addon ################################################################## @@ -279,3 +250,8 @@ RUN apt clean -y && \ rm -rfv /tmp/composer-setup.php && \ rm -rfv /tmp/ioncube.tar.gz +#Final config +VOLUME ["/var/cache/nginx"] +EXPOSE 80 443 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/linux/ecosystem/nginx/1.21.6/php/Makefile b/linux/ecosystem/nginx/1.21.6/php/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/php/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/nginx/1.21.6/php/README.md b/linux/ecosystem/nginx/1.21.6/php/README.md new file mode 100644 index 000000000..034784bc0 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/php/README.md @@ -0,0 +1,30 @@ +# Compose example + +```yml +version: '3.7' +services: + balancer: + image: epicmorg/balancer + restart: unless-stopped + ports: + - "0.0.0.0:80:80" + - "0.0.0.0:443:443" + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /etc/letsencrypt:/etc/letsencrypt + - nginx:/etc/nginx + - nginx-usr:/usr/share/nginx/html + - /var/lib/nginx +# extra_hosts: +# - "example.com:192.168.0.11" + depends_on: + - websites + tmpfs: + - /tmp +volumes: + nginx: + external: true + nginx-usr: + external: true +``` diff --git a/linux/ecosystem/nginx/1.21.6/php/docker-compose.yml b/linux/ecosystem/nginx/1.21.6/php/docker-compose.yml new file mode 100644 index 000000000..0968ca6c1 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/php/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.9' +services: + app: + image: "epicmorg/nginx:${NGINX_VERSION}-php" + build: + context: . + args: + NGINX_VERSION: ${NGINX_VERSION} + NGINX_DOWNLOAD_URL: ${NGINX_DOWNLOAD_URL} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/.env b/linux/ecosystem/nginx/1.21.6/rtmp-hls/.env new file mode 100644 index 000000000..dd46749d4 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/.env @@ -0,0 +1,2 @@ +NGINX_VERSION=1.21.6 +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/Dockerfile b/linux/ecosystem/nginx/1.21.6/rtmp-hls/Dockerfile new file mode 100644 index 000000000..d7d9b5901 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/Dockerfile @@ -0,0 +1,127 @@ +################################################################## +# Set Global ARG to build process +################################################################## +ARG NGINX_VERSION + +################################################################## +# Start build process +################################################################## +FROM epicmorg/nginx:${NGINX_VERSION} +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +ARG NGINX_RTMP_MODULE_VERSION=1.2.1 + +################################################################## +# Clear sources.list.d +################################################################## +RUN rm -rfv /etc/apt/sources.list.d/* + +################################################################## +# sid sources list +################################################################## +RUN rm -rfv /etc/apt/sources.list +COPY sources.list.d/sources.sid.list /etc/apt/sources.list +RUN apt update + +################################################################## +# installing utils +################################################################## +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libpcre3-dev \ + librtmp1 \ + libtheora0 \ + libvorbis-dev \ + libmp3lame0 \ + libx264-dev \ + libx265-dev + + +################################################################## +# stretch sources list + libvpx +################################################################## +RUN rm -rfv /etc/apt/sources.list +COPY sources.list.d/sources.stretch.list /etc/apt/sources.list +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libvpx4 + + +################################################################## +# buster sources list + libvpx +################################################################## +RUN rm -rfv /etc/apt/sources.list +COPY sources.list.d/sources.buster.list /etc/apt/sources.list +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libvpx5 + + +################################################################## +# sid sources list + libvpx +################################################################## +RUN rm -rfv /etc/apt/sources.list +COPY sources.list.d/sources.sid.list /etc/apt/sources.list +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libvpx6 + + +################################################################## +# installing deps for rtmp module +################################################################## +RUN mkdir -p /usr/share/nginx/html \ + /mnt/hls \ + /mnt/dash \ + /tmp/build && \ + chown -R www-data:www-data /mnt/hls && \ + chown -R www-data:www-data /mnt/dash && \ + chmod -R 755 /mnt/hls && \ + chmod -R 755 /mnt/dash && \ + cd /tmp/build && \ + wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_MODULE_VERSION}.tar.gz && \ + tar -zxf v${NGINX_RTMP_MODULE_VERSION}.tar.gz && \ + rm v${NGINX_RTMP_MODULE_VERSION}.tar.gz && \ + cp /tmp/build/nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}/stat.xsl /usr/share/nginx/html/stat.xsl && \ + rm -rf /tmp/build + + +################################################################## +# Forward logs to Docker +################################################################## +RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ + ln -sf /dev/stderr /var/log/nginx/error.log + + +################################################################## +# Copy nginx config file to container +################################################################## +RUN rm -rfv /etc/nginx/nginx.conf \ + /etc/nginx/sites-avalible/default +COPY conf/nginx.conf /etc/nginx/nginx.conf + + +################################################################## +# Copy html players to container +################################################################## +COPY players /usr/share/nginx/html/players + + +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb + + +EXPOSE 1935 +EXPOSE 8080 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/Makefile b/linux/ecosystem/nginx/1.21.6/rtmp-hls/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/README.md b/linux/ecosystem/nginx/1.21.6/rtmp-hls/README.md new file mode 100644 index 000000000..d5a0ec5cc --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/README.md @@ -0,0 +1,78 @@ +# RTMP-HLS Docker + +**BASED ON** [TareqAlqutami/rtmp-hls-server](https://github.com/TareqAlqutami/rtmp-hls-server) + +**Docker image for video streaming server that supports RTMP, HLS, and DASH streams.** + +## Description + +This Docker image can be used to create a video streaming server that supports [**RTMP**](https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol), [**HLS**](https://en.wikipedia.org/wiki/HTTP_Live_Streaming), [**DASH**](https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP) out of the box. +It also allows adaptive streaming and custom transcoding of video streams. +All modules are built from source on Debian and Alpine Linux base images. + +## Features + * The backend is [**Nginx**](http://nginx.org/en/) with [**nginx-rtmp-module**](https://github.com/arut/nginx-rtmp-module). + * [**FFmpeg**](https://www.ffmpeg.org/) for transcoding and adaptive streaming. + * Default settings: + * RTMP is ON + * HLS is ON (adaptive, 5 variants) + * DASH is ON + * Other Nginx configuration files are also provided to allow for RTMP-only streams or no-FFmpeg transcoding. + * Statistic page of RTMP streams at `http://:/stats`. + * Available web video players (based on [video.js](https://videojs.com/) and [hls.js](https://github.com/video-dev/hls.js/)) at `/usr/share/nginx/html/players`. + +## Usage + +### To run the server +``` +docker run -d -p 1935:1935 -p 8080:8080 epicmorg/balancer:rtmp-hls +``` + +To run with custom conf file: +``` +docker run -d -p 1935:1935 -p 8080:8080 -v custom.conf:/etc/nginx/nginx.conf epicmorg/balancer:rtmp-hls +``` +where `custom.conf` is the new conf file for Nginx. + +### To stream to the server + * **Stream live RTMP content to:** + ``` + rtmp://:1935/live/ + ``` + where `` is any stream key you specify. + + * **Configure [OBS](https://obsproject.com/) to stream content:**
+Go to Settings > Stream, choose the following settings: + * Service: Custom Streaming Server. + * Server: `rtmp://:1935/live`. + * Stream key: anything you want, however provided video players assume stream key is `test` + +### To view the stream + * **Using [VLC](https://www.videolan.org/vlc/index.html):** + * Go to Media > Open Network Stream. + * Enter the streaming URL: `rtmp://:1935/live/` + Replace `` with the IP of where the server is running, and + `` with the stream key you used when setting up the stream. + * For HLS and DASH, the URLs are of the forms: + `http://:8080/hls/.m3u8` and + `http://:8080/dash/_src.mpd` respectively. + * Click Play. + +* **Using provided web players:**
+The provided demo players assume the stream-key is called `test` and the player is opened in localhost. + * To play RTMP content (requires Flash): `http://localhost:8080/players/rtmp.html` + * To play HLS content: `http://localhost:8080/players/hls.html` + * To play HLS content using hls.js library: `http://localhost:8080/players/hls_hlsjs.html` + * To play DASH content: `http://localhost:8080/players/dash.html` + * To play RTMP and HLS contents on the same page: `http://localhost:8080/players/rtmp_hls.html` + + **Notes:** + + * These web players are hardcoded to play stream key "test" at localhost. + * To change the stream source for these players. Download the html files and modify the `src` attribute in the video tag in the html file. You can then mount the modified files to the container as follows: + ``` + docker run -d -p 1935:1935 -p 8080:8080 -v custom_players:/usr/share/nginx/html/players epicmorg/balancer:rtmp-hls + ``` + where `custom_players` is the directory holding the modified html files. + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx.conf b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx.conf new file mode 100644 index 000000000..938da01e2 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx.conf @@ -0,0 +1,134 @@ +load_module "/usr/lib/nginx/modules/ngx_rtmp_module.so"; + +worker_processes auto; +#error_log logs/error.log; + +events { + worker_connections 1024; +} + +# RTMP configuration +rtmp { + server { + listen 1935; # Listen on standard RTMP port + chunk_size 4000; + # ping 30s; + # notify_method get; + + # This application is to accept incoming stream + application live { + live on; # Allows live input + + # for each received stream, transcode for adaptive streaming + # This single ffmpeg command takes the input and transforms + # the source into 4 different streams with different bitrates + # and qualities. # these settings respect the aspect ratio. + exec_push /usr/bin/ffmpeg -i rtmp://localhost:1935/$app/$name -async 1 -vsync -1 + -c:v libx264 -c:a aac -b:v 256k -b:a 64k -vf "scale=480:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_low + -c:v libx264 -c:a aac -b:v 768k -b:a 128k -vf "scale=720:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_mid + -c:v libx264 -c:a aac -b:v 1024k -b:a 128k -vf "scale=960:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_high + -c:v libx264 -c:a aac -b:v 1920k -b:a 128k -vf "scale=1280:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_hd720 + -c copy -f flv rtmp://localhost:1935/show/$name_src; + } + + # This is the HLS application + application show { + live on; # Allows live input from above application + deny play all; # disable consuming the stream from nginx as rtmp + + hls on; # Enable HTTP Live Streaming + hls_fragment 3; + hls_playlist_length 20; + hls_path /mnt/hls/; # hls fragments path + # Instruct clients to adjust resolution according to bandwidth + hls_variant _src BANDWIDTH=4096000; # Source bitrate, source resolution + hls_variant _hd720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution + hls_variant _high BANDWIDTH=1152000; # High bitrate, higher-than-SD resolution + hls_variant _mid BANDWIDTH=448000; # Medium bitrate, SD resolution + hls_variant _low BANDWIDTH=288000; # Low bitrate, sub-SD resolution + + # MPEG-DASH + dash on; + dash_path /mnt/dash/; # dash fragments path + dash_fragment 3; + dash_playlist_length 20; + } + } +} + + +http { + include /etc/nginx/sites-enabled/*.conf; + sendfile off; + tcp_nopush on; + directio 512; + # aio on; + + # HTTP server required to serve the player and HLS fragments + server { + listen 8080; + + # Serve HLS fragments + location /hls { + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + + root /mnt; + + add_header Cache-Control no-cache; # Disable cache + + # CORS setup + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Expose-Headers' 'Content-Length'; + + # allow CORS preflight requests + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + } + + # Serve DASH fragments + location /dash { + types { + application/dash+xml mpd; + video/mp4 mp4; + } + + root /mnt; + + add_header Cache-Control no-cache; # Disable cache + + + # CORS setup + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Expose-Headers' 'Content-Length'; + + # Allow CORS preflight requests + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + } + + # This URL provides RTMP statistics in XML + location /stat { + rtmp_stat all; + rtmp_stat_stylesheet stat.xsl; # Use stat.xsl stylesheet + } + + location /stat.xsl { + # XML stylesheet to view RTMP stats. + root /usr/share/nginx/html; + } + + } +} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_no-ffmpeg.conf b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_no-ffmpeg.conf new file mode 100644 index 000000000..99644e14f --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_no-ffmpeg.conf @@ -0,0 +1,118 @@ +load_module "/usr/lib/nginx/modules/ngx_rtmp_module.so"; + +worker_processes auto; +#error_log logs/error.log; + +events { + worker_connections 1024; +} + +# RTMP configuration +rtmp { + server { + listen 1935; # Listen on standard RTMP port + chunk_size 4000; + # ping 30s; + # notify_method get; + + # This application is to accept incoming stream + application live { + live on; # Allows live input + push rtmp://localhost:1935/show; + } + + # This is the HLS application + application show { + live on; # Allows live input from above application + deny play all; # disable consuming the stream from nginx as rtmp + + hls on; # Enable HTTP Live Streaming + hls_fragment 3; + hls_playlist_length 10; + hls_path /mnt/hls/; # hls fragments path + + # MPEG-DASH + dash on; + dash_path /mnt/dash/; # dash fragments path + dash_fragment 3; + dash_playlist_length 10; + } + } +} + + +http { + include /etc/nginx/sites-enabled/*.conf; + sendfile off; + tcp_nopush on; + directio 512; + # aio on; + + # HTTP server required to serve the player and HLS fragments + server { + listen 8080; + + # Serve HLS fragments + location /hls { + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + + root /mnt; + + add_header Cache-Control no-cache; # Disable cache + + # CORS setup + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Expose-Headers' 'Content-Length'; + + # allow CORS preflight requests + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + } + + # Serve DASH fragments + location /dash { + types { + application/dash+xml mpd; + video/mp4 mp4; + } + + root /mnt; + + add_header Cache-Control no-cache; # Disable cache + + + # CORS setup + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Expose-Headers' 'Content-Length'; + + # Allow CORS preflight requests + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + } + + # This URL provides RTMP statistics in XML + location /stat { + rtmp_stat all; + rtmp_stat_stylesheet stat.xsl; # Use stat.xsl stylesheet + } + + location /stat.xsl { + # XML stylesheet to view RTMP stats. + root /usr/share/nginx/html; + } + + } +} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_rtmp_minimal_no-stats.conf b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_rtmp_minimal_no-stats.conf new file mode 100644 index 000000000..780a1d1ff --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/conf/nginx_rtmp_minimal_no-stats.conf @@ -0,0 +1,16 @@ +load_module "/usr/lib/nginx/modules/ngx_rtmp_module.so"; + +worker_processes auto; +rtmp_auto_push on; +events {} +rtmp { + server { + listen 1935; + listen [::]:1935; + + application live { + live on; + record off; + } + } +} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/docker-compose.yml b/linux/ecosystem/nginx/1.21.6/rtmp-hls/docker-compose.yml new file mode 100644 index 000000000..3c46aedbd --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3.9' +services: + app: + image: "epicmorg/nginx:${NGINX_VERSION}-rtmp-hls" + build: + context: . + args: + NGINX_VERSION: ${NGINX_VERSION} + NGINX_DOWNLOAD_URL: ${NGINX_DOWNLOAD_URL} \ No newline at end of file diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/dash.html b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/dash.html new file mode 100644 index 000000000..12b8df786 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/dash.html @@ -0,0 +1,23 @@ + + + + + DASH Live Streaming + + + + +

DASH Player

+ + + + + + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls.html b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls.html new file mode 100644 index 000000000..15d95b4c1 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls.html @@ -0,0 +1,23 @@ + + + + + HLS Live Streaming + + + + +

HLS Player

+ + + + + + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls_hlsjs.html b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls_hlsjs.html new file mode 100644 index 000000000..0237e7a52 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/hls_hlsjs.html @@ -0,0 +1,41 @@ + + + + + HLS streaming + + + + + + + + + + +

HLS Player (using hls.js)

+ +
+
+ +
+
+ + + + + + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp.html b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp.html new file mode 100644 index 000000000..d8ce85610 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp.html @@ -0,0 +1,24 @@ + + + + + RTMP Live Streaming + Live Streaming + + + + + + + +

RTMP Player

+ + + + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp_hls.html b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp_hls.html new file mode 100644 index 000000000..35617e913 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/players/rtmp_hls.html @@ -0,0 +1,30 @@ + + + + + Live Streaming + + + + + + + + +

RTMP Player

+ + +

HLS Player

+ + + + + diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.buster.list b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.buster.list new file mode 100644 index 000000000..412c35d1a --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.buster.list @@ -0,0 +1,19 @@ +#main +deb http://httpredir.debian.org/debian/ buster main contrib non-free +deb-src http://httpredir.debian.org/debian/ buster main contrib non-free +deb http://httpredir.debian.org/debian/ buster-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ buster-updates main contrib non-free +deb http://httpredir.debian.org/debian/ buster-backports main contrib non-free +deb-src http://httpredir.debian.org/debian/ buster-backports main contrib non-free +deb http://httpredir.debian.org/debian/ buster-proposed-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ buster-proposed-updates main contrib non-free + +#security +deb http://httpredir.debian.org/debian-security/ buster/updates main contrib non-free +deb-src http://httpredir.debian.org/debian-security/ buster/updates main contrib non-free + +##multimedia +#deb http://httpredir.debian.org/debian-multimedia/ buster main non-free +#deb-src http://httpredir.debian.org/debian-multimedia/ buster main non-free +#deb http://httpredir.debian.org/debian-multimedia/ buster-backports main +#deb-src http://httpredir.debian.org/debian-multimedia/ buster-backports main diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.sid.list b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.sid.list new file mode 100644 index 000000000..465c737af --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.sid.list @@ -0,0 +1,19 @@ +#main +deb http://httpredir.debian.org/debian/ sid main contrib non-free +deb-src http://httpredir.debian.org/debian/ sid main contrib non-free +deb http://httpredir.debian.org/debian/ testing-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ testing-updates main contrib non-free +deb http://httpredir.debian.org/debian/ testing-proposed-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ testing-proposed-updates main contrib non-free + +#backports +#deb http://httpredir.debian.org/debian/ testing-backports main contrib non-free +#deb-src http://httpredir.debian.org/debian/ testing-backports main contrib non-free + +#security +deb http://httpredir.debian.org/debian-security/ testing-security main contrib non-free +deb-src http://httpredir.debian.org/debian-security/ testing-security main contrib non-free + +##multimedia +#deb http://httpredir.debian.org/debian-multimedia/ sid main non-free +#deb-src http://httpredir.debian.org/debian-multimedia/ sid main non-free diff --git a/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.stretch.list b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.stretch.list new file mode 100644 index 000000000..617bf9bb6 --- /dev/null +++ b/linux/ecosystem/nginx/1.21.6/rtmp-hls/sources.list.d/sources.stretch.list @@ -0,0 +1,19 @@ +#main +deb http://httpredir.debian.org/debian/ stretch main contrib non-free +deb-src http://httpredir.debian.org/debian/ stretch main contrib non-free +deb http://httpredir.debian.org/debian/ stretch-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ stretch-updates main contrib non-free +deb http://httpredir.debian.org/debian/ stretch-backports main contrib non-free +deb-src http://httpredir.debian.org/debian/ stretch-backports main contrib non-free +deb http://httpredir.debian.org/debian/ stretch-proposed-updates main contrib non-free +deb-src http://httpredir.debian.org/debian/ stretch-proposed-updates main contrib non-free + +#security +deb http://httpredir.debian.org/debian-security/ stretch/updates main contrib non-free +deb-src http://httpredir.debian.org/debian-security/ stretch/updates main contrib non-free + +##multimedia +#deb http://httpredir.debian.org/debian-multimedia/ stretch main non-free +#deb-src http://httpredir.debian.org/debian-multimedia/ stretch main non-free +#deb http://httpredir.debian.org/debian-multimedia/ stretch-backports main +#deb-src http://httpredir.debian.org/debian-multimedia/ stretch-backports main diff --git a/linux/ecosystem/nginx/latest/main/.env b/linux/ecosystem/nginx/latest/main/.env index 317e78d3a..15b9807c4 100644 --- a/linux/ecosystem/nginx/latest/main/.env +++ b/linux/ecosystem/nginx/latest/main/.env @@ -1,2 +1,2 @@ NGINX_VERSION=latest -NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.23.2.tar.gz diff --git a/linux/ecosystem/nginx/latest/php/.env b/linux/ecosystem/nginx/latest/php/.env index 317e78d3a..15b9807c4 100644 --- a/linux/ecosystem/nginx/latest/php/.env +++ b/linux/ecosystem/nginx/latest/php/.env @@ -1,2 +1,2 @@ NGINX_VERSION=latest -NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.23.2.tar.gz diff --git a/linux/ecosystem/nginx/latest/rtmp-hls/.env b/linux/ecosystem/nginx/latest/rtmp-hls/.env index 317e78d3a..15b9807c4 100644 --- a/linux/ecosystem/nginx/latest/rtmp-hls/.env +++ b/linux/ecosystem/nginx/latest/rtmp-hls/.env @@ -1,2 +1,2 @@ NGINX_VERSION=latest -NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.21.6.tar.gz +NGINX_DOWNLOAD_URL=http://nginx.org/download/nginx-1.23.2.tar.gz diff --git a/linux/ecosystem/php/php8.0/Dockerfile b/linux/ecosystem/php/php8.0/Dockerfile index d41e122e0..eebb0297a 100644 --- a/linux/ecosystem/php/php8.0/Dockerfile +++ b/linux/ecosystem/php/php8.0/Dockerfile @@ -1,89 +1,3 @@ -FROM epicmorg/debian:bullseye-develop AS builder -LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" -ARG DEBIAN_FRONTEND=noninteractive - -################################################################## -# ARGuments -################################################################## -ENV BuildDocker true - -ARG BUILDS_DIR=/builds -ARG SRC_DIR=${BUILDS_DIR}/src -ARG EXPORT_DIR=${BUILDS_DIR}/export -ARG P4API_DIR=${SRC_DIR}/p4api -ARG P4PHP_DIR=${SRC_DIR}/p4php -ARG MAKE_DIR=${SRC_DIR}/p4php-${PHP_VER} - -ARG P4API_VER=r21.1 -ARG P4API_URL=http://filehost.perforce.com/perforce/${P4API_VER}/bin.linux26x86_64/p4api.tgz - -ARG P4PHP_VER=r20.2 -ARG P4PHP_URL=http://filehost.perforce.com/perforce/${P4PHP_VER}/bin.tools/p4php.tgz - -ARG PHP_VER=8.0 -ARG PHP_MODULE_VER=20200930 -ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} - -################################################################## -# Files and folders -################################################################## -RUN mkdir -p ${BUILDS_DIR} ${SRC_DIR} ${EXPORT_DIR} ${MAKE_DIR} ${P4API_DIR} ${P4PHP_DIR} - -################################################################## -# Installing PHP8 -################################################################## -RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ - sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' - -#Install base packages -RUN apt-get update && \ - apt-get install -y --allow-unauthenticated \ - libmemcached-dev \ - smbclient libsmbclient libsmbclient-dev \ - php8.0 \ - php8.0-dev \ - php8.0-fpm \ - php8.0-cli \ - php8.0-cgi - -################################################################## -# preparing p4src -################################################################## -RUN wget -qO - ${P4API_URL} | tar -zxv --strip-components=1 -C ${P4API_DIR} && \ - wget -qO - ${P4API_URL} | tar -zxv --strip-components=1 -C ${MAKE_DIR} && \ - wget -qO - ${P4PHP_URL} | tar -zxv --strip-components=1 -C ${P4PHP_DIR} && \ - wget -qO - ${P4PHP_URL} | tar -zxv --strip-components=1 -C ${MAKE_DIR} && \ - cd ${P4API_DIR} && \ - ls -las && \ - cd ${P4PHP_DIR} && \ - ls -las && \ - cd ${MAKE_DIR} && \ - ls -las && \ - cd ${SRC_DIR} && \ - ls -las - -################################################################## -# compilling p4src -################################################################## -RUN cd ${MAKE_DIR} && \ - ls -las && \ - phpize && \ - ./configure --with-perforce=${P4API_DIR} && \ - make && \ - make test && \ - make install && \ - cp ${PHP_MODULE_PATH}/perforce.so ${EXPORT_DIR} - -################################################################## -# compilling smbclient -################################################################## -RUN pecl install smbclient && \ - cp ${PHP_MODULE_PATH}/smbclient.so ${EXPORT_DIR} - -################################################################## -################################################################## -################################################################## - FROM epicmorg/debian:bullseye LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" ARG DEBIAN_FRONTEND=noninteractive @@ -143,6 +57,7 @@ RUN apt-get update && \ php8.0-gmagick \ php8.0-gnupg \ php8.0-redis \ + php8.0-smbclient \ smbclient libsmbclient \ php8.0-yaml \ # php8.0-geoip \ @@ -222,43 +137,22 @@ RUN apt-get update && \ php -m && \ php -v -################################################################## -# not supported with php8 -################################################################## -# Installing IOnCube addon -################################################################# -#ADD https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz /tmp/ioncube.tar.gz -#RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \ -# cp /tmp/ioncube/ioncube_loader_lin_7.4.so ${PHP_MODULE_PATH} && \ -## echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/apache2/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cgi/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/cli/php.ini && \ -# echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_7.4.so" >> ${PHP_DIR}/fpm/php.ini && \ -# php -m && \ -# php -v - ################################################################## # Installing P4 addon ################################################################## -COPY --from=builder /builds/export/perforce.so ${PHP_MODULE_PATH} -RUN echo "extension = ${PHP_MODULE_PATH}/perforce.so" > ${P4_PHP_INI} && \ +RUN wget -q --no-check-certificate -c http://ftp.perforce.com/perforce/r20.2/bin.linux26x86_64/perforce_php80.so --random-wait -O ${PHP_MODULE_PATH}/perforce_php80.so && \ + wget -q --no-check-certificate -c http://ftp.perforce.com/perforce/r20.2/bin.linux26x86_64/perforce_php80-ssl1.0.2.so --random-wait -O ${PHP_MODULE_PATH}/perforce_php80-ssl1.0.2.so && \ + wget -q --no-check-certificate -c http://ftp.perforce.com/perforce/r20.2/bin.linux26x86_64/perforce_php80-ssl1.1.1.so --random-wait -O ${PHP_MODULE_PATH}/perforce_php80-ssl1.1.1.so + +#COPY --from=builder /builds/export/perforce.so ${PHP_MODULE_PATH} + +RUN echo "extension = ${PHP_MODULE_PATH}/perforce_php80-ssl1.1.1.so" > ${P4_PHP_INI} && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/cgi/conf.d/perforce.ini && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/cli/conf.d/perforce.ini && \ ln -sf ${P4_PHP_INI} ${PHP_DIR}/fpm/conf.d/perforce.ini && \ php -m && \ php -v -################################################################## -# Installing smbclient addon -################################################################## -COPY --from=builder /builds/export/smbclient.so ${PHP_MODULE_PATH} -RUN echo "extension = ${PHP_MODULE_PATH}/smbclient.so" > ${SMB_PHP_INI} && \ - ln -sf ${SMB_PHP_INI} ${PHP_DIR}/cgi/conf.d/smbclient.ini && \ - ln -sf ${SMB_PHP_INI} ${PHP_DIR}/cli/conf.d/smbclient.ini && \ - ln -sf ${SMB_PHP_INI} ${PHP_DIR}/fpm/conf.d/smbclient.ini && \ - php -m && \ - php -v - ################################################################## # Installing Composer addon ################################################################## diff --git a/linux/ecosystem/php/php8.1/Dockerfile b/linux/ecosystem/php/php8.1/Dockerfile new file mode 100644 index 000000000..a94a6a9d0 --- /dev/null +++ b/linux/ecosystem/php/php8.1/Dockerfile @@ -0,0 +1,172 @@ +FROM epicmorg/debian:bullseye +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +ARG PHP_MODULE_VER=20210902 +ARG PHP_MODULE_PATH=/usr/lib/php/${PHP_MODULE_VER} +ARG PHP_VER=8.1 +ARG PHP_DIR=/etc/php/${PHP_VER} +ARG P4_PHP_INI=${PHP_DIR}/mods-available/perfroce.ini +ARG SMB_PHP_INI=${PHP_DIR}/mods-available/smbclient.ini + +################################################################## +# Installing PHP8 +################################################################## +RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ + sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' + +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libmemcached-dev \ + php8.1 \ + php8.1-dev \ + php8.1-fpm \ + php8.1-cli \ + php8.1-cgi \ + php-pear \ + php8.1-gmp \ + php8.1-snmp \ + php8.1-ldap \ + php8.1-mail \ + php8.1-soap \ + php8.1-mysql \ + php8.1-memcached \ + php8.1-memcache \ + php8.1-igbinary \ + php8.1-interbase \ + php8.1-curl \ + php8.1-gd \ + php8.1-intl \ + php8.1-zip \ + php8.1-bcmath \ + php8.1-imap \ + php8.1-pspell \ + php8.1-sqlite3 \ + php8.1-pgsql \ + php8.1-tidy \ + php8.1-xmlrpc \ + php8.1-xml \ + php8.1-mbstring \ + php8.1-apcu \ + php8.1-common \ +# php8.1-json \ + php8.1-readline \ + php8.1-enchant \ + php8.1-ssh2 \ + php8.1-oauth \ + php8.1-gmagick \ + php8.1-gnupg \ + php8.1-redis \ + php8.1-smbclient \ + smbclient libsmbclient \ + php8.1-yaml \ +# php8.1-geoip \ + sendmail && \ + ln -sf /etc/ssl/dhparam.pem /etc/php/dhparam.pem && \ + update-alternatives --set php /usr/bin/php8.1 && \ + pecl channel-update pecl.php.net && \ + php -m && \ + php -v + +################################################################## +# Enabling extensions +################################################################## +RUN phpenmod \ + snmp \ + gmp \ + calendar \ + ldap \ + curl \ + exif \ + ftp \ + fileinfo \ + gd \ + geoip \ + gnupg \ + iconv \ + imap \ + json \ + mbstring \ + memcached \ + mysqli \ + mysqlnd \ + oauth \ + pdo_mysql \ + pdo_sqlite \ + phar \ + posix \ + readline \ + redis \ + simplexml \ + sockets \ + sqlite3 \ + ssh2 \ + tokenizer \ + xml \ + xmlreader \ + xmlrpc \ + xmlwriter \ + xsl \ + yaml && \ + php -m && \ + php -v + +################################################################## +# Installing timezonedb addon +################################################################## +RUN pecl install timezonedb && \ +# echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/apache2/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/cgi/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/cli/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/timezonedb.so" >> ${PHP_DIR}/fpm/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing imagic addon +################################################################## +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + libmagickwand-dev \ + imagemagick && \ + pecl install imagick && \ +# echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/apache2/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/cgi/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/cli/php.ini && \ + echo "extension = ${PHP_MODULE_PATH}/imagick.so" >> ${PHP_DIR}/fpm/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing IOnCube addon +################################################################# +ADD https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz /tmp/ioncube.tar.gz +RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \ + cp /tmp/ioncube/ioncube_loader_lin_8.1.so ${PHP_MODULE_PATH} && \ +## echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_8.1.so" >> ${PHP_DIR}/apache2/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_8.1.so" >> ${PHP_DIR}/cgi/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_8.1.so" >> ${PHP_DIR}/cli/php.ini && \ + echo "zend_extension = ${PHP_MODULE_PATH}/ioncube_loader_lin_8.1.so" >> ${PHP_DIR}/fpm/php.ini && \ + php -m && \ + php -v + +################################################################## +# Installing Composer addon +################################################################## +RUN cd /tmp && \ + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ + php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ + rm /tmp/composer-setup.php + +################################################################## +# cleaninig up +################################################################## +RUN apt clean -y && \ + apt autoclean -y && \ + rm -rfv /var/lib/apt/lists/* && \ + rm -rfv /var/cache/apt/archives/*.deb && \ + rm -rfv /tmp/deb/* && \ + rm -rfv /tmp/ioncube/* && \ + rm -rfv /tmp/composer-setup.php && \ + rm -rfv /tmp/ioncube.tar.gz + diff --git a/linux/ecosystem/php/php8.1/Makefile b/linux/ecosystem/php/php8.1/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/php/php8.1/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/php/php8.1-p4-not-ready/README.md b/linux/ecosystem/php/php8.1/README.md similarity index 100% rename from linux/ecosystem/php/php8.1-p4-not-ready/README.md rename to linux/ecosystem/php/php8.1/README.md diff --git a/linux/ecosystem/php/php8.1-p4-not-ready/docker-compose.yml b/linux/ecosystem/php/php8.1/docker-compose.yml similarity index 100% rename from linux/ecosystem/php/php8.1-p4-not-ready/docker-compose.yml rename to linux/ecosystem/php/php8.1/docker-compose.yml diff --git a/linux/ecosystem/postgres/10/Dockerfile b/linux/ecosystem/postgres/10/Dockerfile index 766aba8d6..b69e1e80e 100644 --- a/linux/ecosystem/postgres/10/Dockerfile +++ b/linux/ecosystem/postgres/10/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -34,6 +34,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F ENV PG_MAJOR 10 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/11/Dockerfile b/linux/ecosystem/postgres/11/Dockerfile index dc650590e..5cbbc970d 100644 --- a/linux/ecosystem/postgres/11/Dockerfile +++ b/linux/ecosystem/postgres/11/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -34,6 +34,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F ENV PG_MAJOR 11 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/12/Dockerfile b/linux/ecosystem/postgres/12/Dockerfile index e8fb6c9ad..37853d301 100644 --- a/linux/ecosystem/postgres/12/Dockerfile +++ b/linux/ecosystem/postgres/12/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -34,6 +34,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F ENV PG_MAJOR 12 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/13/Dockerfile b/linux/ecosystem/postgres/13/Dockerfile index fc82b7532..02d213a3a 100644 --- a/linux/ecosystem/postgres/13/Dockerfile +++ b/linux/ecosystem/postgres/13/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -34,6 +34,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F ENV PG_MAJOR 13 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/14/Dockerfile b/linux/ecosystem/postgres/14/Dockerfile index 374cee24f..4703e414a 100644 --- a/linux/ecosystem/postgres/14/Dockerfile +++ b/linux/ecosystem/postgres/14/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -34,6 +34,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F ENV PG_MAJOR 14 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/15/Dockerfile b/linux/ecosystem/postgres/15/Dockerfile index b57b2a2bd..c4411e336 100644 --- a/linux/ecosystem/postgres/15/Dockerfile +++ b/linux/ecosystem/postgres/15/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -29,11 +29,12 @@ ENV LANG en_US.utf8 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 #################################################################################################################################### -# http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/ +# http://apt.postgresql.org/pub/repos/apt/pool/15/p/postgresql-15/ #################################################################################################################################### ENV PG_MAJOR 15 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/postgres/16/Dockerfile b/linux/ecosystem/postgres/16/Dockerfile index 506712364..2d997d896 100644 --- a/linux/ecosystem/postgres/16/Dockerfile +++ b/linux/ecosystem/postgres/16/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -29,17 +29,20 @@ ENV LANG en_US.utf8 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 #################################################################################################################################### -# http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/ +# http://apt.postgresql.org/pub/repos/apt/pool/16/p/postgresql-16/ #################################################################################################################################### ENV PG_MAJOR 16 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ +# && apt-cache policy libpq5 && apt-get install -y \ + libpq5=16~~devel-1.pgdg120+~20221112.1758.g97c61f7 \ postgresql-$PG_MAJOR \ postgresql-contrib-$PG_MAJOR \ && rm -rf /var/lib/apt/lists/* diff --git a/linux/ecosystem/postgres/8.2/Dockerfile b/linux/ecosystem/postgres/8.2/Dockerfile index 12d729678..461d71fc7 100644 --- a/linux/ecosystem/postgres/8.2/Dockerfile +++ b/linux/ecosystem/postgres/8.2/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/8.3/Dockerfile b/linux/ecosystem/postgres/8.3/Dockerfile index f33c59f41..df468711f 100644 --- a/linux/ecosystem/postgres/8.3/Dockerfile +++ b/linux/ecosystem/postgres/8.3/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/8.4/Dockerfile b/linux/ecosystem/postgres/8.4/Dockerfile index 8c360a073..f5992fc3f 100644 --- a/linux/ecosystem/postgres/8.4/Dockerfile +++ b/linux/ecosystem/postgres/8.4/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.0/Dockerfile b/linux/ecosystem/postgres/9.0/Dockerfile index 563e7d560..3bc65f070 100644 --- a/linux/ecosystem/postgres/9.0/Dockerfile +++ b/linux/ecosystem/postgres/9.0/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.1/Dockerfile b/linux/ecosystem/postgres/9.1/Dockerfile index 500f18ddd..0ae6111f0 100644 --- a/linux/ecosystem/postgres/9.1/Dockerfile +++ b/linux/ecosystem/postgres/9.1/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.2/Dockerfile b/linux/ecosystem/postgres/9.2/Dockerfile index 2e8fde15d..81545e57d 100644 --- a/linux/ecosystem/postgres/9.2/Dockerfile +++ b/linux/ecosystem/postgres/9.2/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.3/Dockerfile b/linux/ecosystem/postgres/9.3/Dockerfile index f6ca82e52..5d571e52c 100644 --- a/linux/ecosystem/postgres/9.3/Dockerfile +++ b/linux/ecosystem/postgres/9.3/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.4/Dockerfile b/linux/ecosystem/postgres/9.4/Dockerfile index 61faed099..9832ec6e4 100644 --- a/linux/ecosystem/postgres/9.4/Dockerfile +++ b/linux/ecosystem/postgres/9.4/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.5/Dockerfile b/linux/ecosystem/postgres/9.5/Dockerfile index e57c1d688..037484fdd 100644 --- a/linux/ecosystem/postgres/9.5/Dockerfile +++ b/linux/ecosystem/postgres/9.5/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/9.6/Dockerfile b/linux/ecosystem/postgres/9.6/Dockerfile index 7ba133b0a..eb935c013 100644 --- a/linux/ecosystem/postgres/9.6/Dockerfile +++ b/linux/ecosystem/postgres/9.6/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/linux/ecosystem/postgres/latest/Dockerfile b/linux/ecosystem/postgres/latest/Dockerfile index 374cee24f..c4411e336 100644 --- a/linux/ecosystem/postgres/latest/Dockerfile +++ b/linux/ecosystem/postgres/latest/Dockerfile @@ -14,7 +14,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres ENV GOSU_VER 1.14 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 \ + && wget -q --no-check-certificate -c https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-amd64 --random-wait -O /usr/local/bin/gosu \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl @@ -29,11 +29,12 @@ ENV LANG en_US.utf8 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 #################################################################################################################################### -# http://apt.postgresql.org/pub/repos/apt/pool/14/p/postgresql-14/ +# http://apt.postgresql.org/pub/repos/apt/pool/15/p/postgresql-15/ #################################################################################################################################### -ENV PG_MAJOR 14 +ENV PG_MAJOR 15 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-snapshot main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list && \ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/Dockerfile b/linux/ecosystem/teamcity/agent/php8.1/Dockerfile similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/Dockerfile rename to linux/ecosystem/teamcity/agent/php8.1/Dockerfile diff --git a/linux/ecosystem/teamcity/agent/php8.1/Makefile b/linux/ecosystem/teamcity/agent/php8.1/Makefile new file mode 100644 index 000000000..9ef622aa9 --- /dev/null +++ b/linux/ecosystem/teamcity/agent/php8.1/Makefile @@ -0,0 +1,19 @@ +all: app + +app: + make build + make deploy + make clean + +build: + docker-compose build --compress --parallel --progress plain + +deploy: + docker-compose push + +clean: + docker container prune -f + docker image prune -f + docker network prune -f + docker volume prune -f + docker system prune -af diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/README.md b/linux/ecosystem/teamcity/agent/php8.1/README.md similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/README.md rename to linux/ecosystem/teamcity/agent/php8.1/README.md diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/docker-compose.yml b/linux/ecosystem/teamcity/agent/php8.1/docker-compose.yml similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/docker-compose.yml rename to linux/ecosystem/teamcity/agent/php8.1/docker-compose.yml diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/run-agent.sh b/linux/ecosystem/teamcity/agent/php8.1/run-agent.sh similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/run-agent.sh rename to linux/ecosystem/teamcity/agent/php8.1/run-agent.sh diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/run-services.sh b/linux/ecosystem/teamcity/agent/php8.1/run-services.sh similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/run-services.sh rename to linux/ecosystem/teamcity/agent/php8.1/run-services.sh diff --git a/linux/ecosystem/teamcity/agent/php8.1-not-ready/sources.sid.list b/linux/ecosystem/teamcity/agent/php8.1/sources.sid.list similarity index 100% rename from linux/ecosystem/teamcity/agent/php8.1-not-ready/sources.sid.list rename to linux/ecosystem/teamcity/agent/php8.1/sources.sid.list