update php and improve docker docs
This commit is contained in:
parent
55a093925f
commit
4afec792c4
3 changed files with 137 additions and 33 deletions
151
docs/docker.md
151
docs/docker.md
|
@ -1,33 +1,65 @@
|
|||
# Install guide for Docker
|
||||
#### Install guide for Docker
|
||||
|
||||
When using docker container any environment variables prefixed with `FOURGET_` will be added to the generated config located at `/var/www/html/4get/data/config.php`
|
||||
|
||||
#### Special environment variables
|
||||
|
||||
| Name | value | Example |
|
||||
| - | - | - |
|
||||
| FOURGET_PROTO | "http" or "https" | "https" |
|
||||
| FOURGET_INSTANCES | comma separated string of urls | "https://4get.ca,https://domain.tld" |
|
||||
|
||||
#### Important directories
|
||||
|
||||
| Mountpoint | Description |
|
||||
| - | - |
|
||||
| /etc/4get/certs | SSL certificate directory |
|
||||
| /var/www/html/4get/banner | Custom Banners directory |
|
||||
| /var/www/html/4get/data/captcha | Captcha dataset |
|
||||
|
||||
|
||||
the certificate directory `/etc/4get/certs` expects files named `fullchain.pem` and `privkey.pem`
|
||||
|
||||
The captcha dataset should have a subdirectory for each category. In each category, images should be named from 1.png to X.png, and be 100x100 in size.
|
||||
|
||||
example directory structure:
|
||||
|
||||
```
|
||||
docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" luuul/4get:latest
|
||||
captcha/
|
||||
birds/
|
||||
1.png
|
||||
2.png
|
||||
3.png
|
||||
anime/
|
||||
1.png
|
||||
2.png
|
||||
```
|
||||
|
||||
For more information on configuration view [data/config.php](../data/config.php)
|
||||
|
||||
#### Usage
|
||||
|
||||
You can start 4get with
|
||||
|
||||
```
|
||||
docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="http" luuul/4get:latest
|
||||
```
|
||||
|
||||
...Or with SSL:
|
||||
```
|
||||
docker run -d -p 443:443 -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs -e FOURGET_SERVER_NAME="4get.ca" luuul/4get:latest
|
||||
```
|
||||
|
||||
if the certificate files are not mounted to /etc/4get/certs the service listens to port 80
|
||||
|
||||
the certificate directory expects files named `fullchain.pem` and `privkey.pem`
|
||||
|
||||
# Install using Docker Compose
|
||||
|
||||
copy `docker-compose.yaml`
|
||||
|
||||
to serve custom banners create a directory named `banners` for example with images and mount to `/var/www/html/4get/banner`
|
||||
|
||||
to serve captcha images create a directory named `captchas` for example containing subfolders with images and mount to `/var/www/html/4get/data/captcha`
|
||||
|
||||
any environment variables prefixed with `FOURGET_` will be added to the generated config
|
||||
|
||||
the entrypoint will automatically set the `CAPTCHA_DATASET` value for you based on directory names and number of files in each
|
||||
|
||||
to set `INSTANCES` pass a comma separated string of urls (FOURGET_INSTANCES = "https://4get.ca,https://domain.tld")
|
||||
|
||||
```
|
||||
docker run -d -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="https" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs luuul/4get:latest
|
||||
```
|
||||
|
||||
|
||||
#### With Docker Compose
|
||||
|
||||
Replace relevant values and start with `docker compose up -d`
|
||||
|
||||
##### HTTP
|
||||
|
||||
```
|
||||
# docker-compose.yaml
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
|
@ -35,16 +67,81 @@ services:
|
|||
image: luuul/4get:latest
|
||||
restart: always
|
||||
environment:
|
||||
- FOURGET_VERSION=6
|
||||
- FOURGET_PROTO=http
|
||||
- FOURGET_SERVER_NAME=4get.ca
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
```
|
||||
|
||||
##### HTTPS
|
||||
|
||||
```
|
||||
# docker-compose.yaml
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
fourget:
|
||||
image: luuul/4get:latest
|
||||
restart: always
|
||||
environment:
|
||||
- FOURGET_VERSION=6
|
||||
- FOURGET_PROTO=https
|
||||
- FOURGET_SERVER_NAME=4get.ca
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
|
||||
|
||||
volumes:
|
||||
- /etc/letsencrypt/live/domain.tld:/etc/4get/certs
|
||||
- ./banners:/var/www/html/4get/banner
|
||||
- ./captchas:/var/www/html/4get/data/captcha
|
||||
```
|
||||
|
||||
Replace relevant values and start with `docker compose up -d`
|
||||
##### Captcha Enabled
|
||||
|
||||
Set `FOURGET_BOT_PROTECTION=1` and mount a directory containing captcha files to `/var/www/html/4get/data/captcha`
|
||||
|
||||
|
||||
```
|
||||
# docker-compose.yaml
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
fourget:
|
||||
image: luuul/4get:latest
|
||||
restart: always
|
||||
environment:
|
||||
- FOURGET_VERSION=6
|
||||
- FOURGET_PROTO=http
|
||||
- FOURGET_SERVER_NAME=4get.ca
|
||||
- FOURGET_BOT_PROTECTION=1
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
|
||||
volumes:
|
||||
- ./captcha:/var/www/html/4get/data/captcha
|
||||
```
|
||||
|
||||
##### Custom Banners
|
||||
|
||||
```
|
||||
# docker-compose.yaml
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
fourget:
|
||||
image: luuul/4get:latest
|
||||
restart: always
|
||||
environment:
|
||||
- FOURGET_VERSION=6
|
||||
- FOURGET_PROTO=http
|
||||
- FOURGET_SERVER_NAME=4get.ca
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
|
||||
volumes:
|
||||
- ./banners:/var/www/html/4get/banner
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue