diff --git a/.drone.yml b/.drone.yml index 7f77344..faa0da3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,3 +24,24 @@ steps: event: - push - cron + + - name: build_and_publish_php74 + image: plugins/docker:linux-amd64 + settings: + force_tag: true + password: + from_secret: docker_password + registry: docker.asperti.com + repo: docker.asperti.com/paspo/webserver-nginx + context: . + dockerfile: ./Dockerfile-php74 + username: + from_secret: docker_username + tags: + - latest-php74 + when: + branch: + - master + event: + - push + - cron diff --git a/Dockerfile-php74 b/Dockerfile-php74 new file mode 100644 index 0000000..abd92fc --- /dev/null +++ b/Dockerfile-php74 @@ -0,0 +1,20 @@ +FROM alpine:3.15 + +RUN \ + apk -U upgrade && \ + apk add tini nginx openssh-server \ + php7 php7-fpm php7-mbstring php7-curl php7-ctype php7-dom php7-gd php7-json php7-openssl php7-session php7-simplexml php7-xml php7-zip \ + php7-apcu php7-opcache php7-pecl-yaml php7-sqlite3 php7-mysqli + +COPY rootfs-php74 / + +VOLUME [ "/data/www", "/ssh" ] + +ENV \ + USERNAME=theuser \ + PHP=none \ + PUID=1000 \ + PGID=1000 \ + TZ=Etc/UTC + +ENTRYPOINT [ "/sbin/tini", "/app/entrypoint.sh" ] diff --git a/rootfs-php74/app/entrypoint.sh b/rootfs-php74/app/entrypoint.sh new file mode 100755 index 0000000..bbbadd6 --- /dev/null +++ b/rootfs-php74/app/entrypoint.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +WEBROOT=/data/www +PHP=${PHP:-none} +USERNAME=${USERNAME:-theuser} +PUID=${PUID:-1000} +GROUPNAME=${GROUPNAME:-thegroup} +PGID=${PGID:-1000} +RANDOMPWD=$(tr -dc A-Za-z0-9 "/etc/${PHP}/php-fpm-d/www.conf" < + + +Welcome to nginx! + + + +

Welcome to nginx!

+

If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +nginx.org.
+Commercial support is available at +nginx.com.

+ +

Thank you for using nginx.

+ + diff --git a/rootfs-php74/etc/nginx/conf.d/nodaemon.conf b/rootfs-php74/etc/nginx/conf.d/nodaemon.conf new file mode 100644 index 0000000..ef1f9c1 --- /dev/null +++ b/rootfs-php74/etc/nginx/conf.d/nodaemon.conf @@ -0,0 +1 @@ +daemon off; diff --git a/rootfs-php74/etc/nginx/custom.d/.placeholder b/rootfs-php74/etc/nginx/custom.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/rootfs-php74/etc/php7/php-fpm.d/errlog.conf b/rootfs-php74/etc/php7/php-fpm.d/errlog.conf new file mode 100644 index 0000000..e50a4ee --- /dev/null +++ b/rootfs-php74/etc/php7/php-fpm.d/errlog.conf @@ -0,0 +1 @@ +error_log = /dev/stderr diff --git a/rootfs-php74/etc/ssh/sshd_config.d/port.conf b/rootfs-php74/etc/ssh/sshd_config.d/port.conf new file mode 100644 index 0000000..541d4c1 --- /dev/null +++ b/rootfs-php74/etc/ssh/sshd_config.d/port.conf @@ -0,0 +1 @@ +Port 22 diff --git a/rootfs-php74/etc/ssh/sshd_config.d/sshd.conf b/rootfs-php74/etc/ssh/sshd_config.d/sshd.conf new file mode 100644 index 0000000..6e573f4 --- /dev/null +++ b/rootfs-php74/etc/ssh/sshd_config.d/sshd.conf @@ -0,0 +1,24 @@ +HostKey /ssh/ssh_host_rsa_key +HostKey /ssh/ssh_host_ecdsa_key +HostKey /ssh/ssh_host_ed25519_key + +#SyslogFacility AUTH +LogLevel INFO +LoginGraceTime 1m +PermitRootLogin no +PubkeyAuthentication yes +MaxAuthTries 3 +PrintMotd no + +AuthorizedKeysFile /ssh/authorized_keys +PasswordAuthentication no + +AllowAgentForwarding no +AllowTcpForwarding no +GatewayPorts no +X11Forwarding no + +Subsystem sftp internal-sftp + +ChrootDirectory /data +ForceCommand internal-sftp -d /data/www