more user-friendly readme and docker-compose example
Build Container Image / build_amd64 (push) Successful in 57s Details
Build Container Image / build_arm64 (push) Successful in 1m2s Details
Build Container Image / publish_arm64 (push) Successful in 31s Details
Build Container Image / publish_amd64 (push) Successful in 44s Details
Build Container Image / build_manifest (push) Successful in 7s Details
Build Container Image / publish_manifest (push) Successful in 26s Details

This commit is contained in:
Daniel Wolf 2023-06-21 15:29:31 -04:00
parent ca98545962
commit 6c6275b0cb
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
3 changed files with 61 additions and 67 deletions

View File

@ -1,6 +1,6 @@
.drone.yml
.git .git
.gitea .gitea
.gitignore .gitignore
LICENSE.md LICENSE.md
README.md README.md
docker-compose.yml

110
README.md
View File

@ -2,89 +2,67 @@
[Docker](https://hub.docker.com/r/nephatrine/nginx-h5ai/) | [Docker](https://hub.docker.com/r/nephatrine/nginx-h5ai/) |
[unRAID](https://code.nephatrine.net/NephNET/unraid-containers) [unRAID](https://code.nephatrine.net/NephNET/unraid-containers)
# H5AI Web Index # NGINX H5AI Web Index
This docker container manages the NGINX application with the H5AI PHP web This docker container manages the NGINX application with the H5AI PHP web
server index application. server index application.
Just put files and folders into the volume mapped to `/mnt/media` and they will The `latest` tag points to version `0.31.0-glubsy` and this is the only image
be made accessible through the web interface. For private files, you can either actively being updated. There are tags for older versions, but these may no
lock them down via the NGINX config or use a container that is not publicly longer be using the latest NGINX version, PHP version, or Alpine version and
accessible in the first place. packages.
If using this as a standalone web server, you can configure TLS the same way as If using this as a standalone web server, you can configure TLS the same way as
the [nginx-ssl](https://code.nephatrine.net/NephNET/docker-nginx-ssl) container. the [nginx-ssl](https://code.nephatrine.net/NephNET/docker-nginx-ssl) container.
If part of a larger envinronment, we suggest using a separate container as a If part of a larger envinronment, we suggest using a separate container as a
reverse proxy server and handle TLS there instead. reverse proxy server and handle TLS there instead.
- [Alpine Linux](https://alpinelinux.org/) w/ [S6 Overlay](https://github.com/just-containers/s6-overlay)
- [NGINX](https://www.nginx.com/) w/ [CertBot](https://certbot.eff.org/)
- [PHP](https://www.php.net/) w/ [H5AI](https://larsjung.de/h5ai/)
You can spin up a quick temporary test container like this:
~~~
docker run --rm -p 80:80 -it nephatrine/nginx-h5ai:latest /bin/bash
~~~
**Remember to change the password in the h5ai configuration as the info page might expose information about your server that you do not want exposed.** **Remember to change the password in the h5ai configuration as the info page might expose information about your server that you do not want exposed.**
## Docker Tags ## Docker-Compose
- **nephatrine/nginx-h5ai:latest**: H5AI 0.31.0-glubsy / Alpine Latest This is an example docker-compose file:
## Configuration Variables ```yaml
services:
h5ai:
image: nephatrine/nginx-h5ai:latest
container_name: h5ai
environment:
TZ: America/New_York
PUID: 1000
PGID: 1000
ADMINIP: 127.0.0.1
TRUSTSN: 192.168.0.0/16
DNSADDR: "8.8.8.8 8.8.4.4"
ports:
- "8080:80/tcp"
volumes:
- /mnt/containers/h5ai:/mnt/config
- /mnt/containers/public:/mnt/media
```
You can set these parameters using the syntax ``-e "VARNAME=VALUE"`` on your ## Publishing Files
``docker run`` command. Some of these may only be used during initial
configuration and further changes may need to be made in the generated
configuration files.
- ``ADMINIP``: Administrator IP (*127.0.0.1*) (INITIAL CONFIG) Just put files and folders into the volume mapped to `/mnt/media` and they will
- ``DNSADDR``: Resolver IPs (*8.8.8.8 8.8.4.4*) (INITIAL CONFIG) be made accessible through the web interface. For private files, you can either
- ``PUID``: Mount Owner UID (*1000*) lock them down via the NGINX config or use a container that is not publicly
- ``PGID``: Mount Owner GID (*100*) accessible in the first place.
- ``TRUSTSN``: Trusted Subnet (*192.168.0.0/16*) (INITIAL CONFIG)
- ``TZ``: System Timezone (*America/New_York*)
## Persistent Mounts ## Server Configuration
You can provide a persistent mountpoint using the ``-v /host/path:/container/path`` These are the configuration and data files you will likely need to be aware of
syntax. These mountpoints are intended to house important configuration files, and potentially customize.
logs, and application state (e.g. databases) so they are not lost on image
update.
- ``/mnt/config``: Persistent Data. - `/mnt/config/etc/mime.type`
- ``/mnt/media``: Indexed Location. - `/mnt/config/etc/nginx.conf`
- `/mnt/config/etc/nginx.d/*`
- `/mnt/config/www/default/*`
- `/mnt/config/etc/php.d/*`
- `/mnt/config/etc/php.ini`
- `/mnt/config/etc/php-fpm.conf`
- `/mnt/config/etc/php-fpm.d/*`
- `/mnt/media/_h5ai/private/conf/options.json`
Do not share ``/mnt/config`` volumes between multiple containers as they may Modifications to some of these may require a service restart to pull in the
interfere with the operation of one another. changes made.
The ``/mnt/media/`` volume will have an `_h5ai` folder created in it, but
otherwise will not be modified.
You can perform some basic configuration of the container using the files and
directories listed below.
- ``/mnt/config/etc/crontabs/<user>``: User Crontabs.
- ``/mnt/config/etc/logrotate.conf``: Logrotate Global Configuration.
- ``/mnt/config/etc/logrotate.d/``: Logrotate Additional Configuration.
- ``/mnt/config/etc/mime.type``: NGINX MIME Types.
- ``/mnt/config/etc/nginx.conf``: NGINX Configuration.
- ``/mnt/config/etc/nginx.d/``: NGINX Configuration.
- ``/mnt/config/etc/php.d/*``: PHP Extension Configuration
- ``/mnt/config/etc/php.ini``: PHP General Configuration
- ``/mnt/config/etc/php-fpm.conf``: PHP-FPM General Configuration
- ``/mnt/config/etc/php-fpm.d/*``: PHP-FPM Per-Site Configuration
- ``/mnt/media/_h5ai/private/conf/options.json``: H5AI Configuration
**[*] Changes to some configuration files may require service restart to take
immediate effect.**
## Network Services
This container runs network services that are intended to be exposed outside
the container. You can map these to host ports using the ``-p HOST:CONTAINER``
or ``-p HOST:CONTAINER/PROTOCOL`` syntax.
- ``80/tcp``: HTTP Server. This is the default insecure web server.

16
docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
services:
h5ai:
build: .
container_name: h5ai
environment:
TZ: America/New_York
PUID: 1000
PGID: 1000
ADMINIP: 127.0.0.1
TRUSTSN: 192.168.0.0/16
DNSADDR: "8.8.8.8 8.8.4.4"
ports:
- "8080:80/tcp"
volumes:
- /mnt/containers/h5ai:/mnt/config
- /mnt/containers/public:/mnt/media