Reformat to use 4 spaces

This commit is contained in:
Varakh 2021-05-21 01:03:02 +02:00
parent 6b13226a2d
commit 75c76f77c3
5 changed files with 75 additions and 54 deletions

6
.editorconfig Normal file
View file

@ -0,0 +1,6 @@
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

View file

@ -1,5 +1,6 @@
# CHANGELOG # CHANGELOG
## 2021-01-30 ## 2021-01-30
* Updated docker image to include latest alpine package changes * Updated docker image to include latest alpine package changes
* Fixed start of `crond` in s6 overlay, included `crontab` file will be run every 15 minutes correctly now * Fixed start of `crond` in s6 overlay, included `crontab` file will be run every 15 minutes correctly now

View file

@ -2,17 +2,22 @@
A docker image for [FileBin](https://github.com/Bluewind/filebin) to have it up and running in seconds. A docker image for [FileBin](https://github.com/Bluewind/filebin) to have it up and running in seconds.
Visit project on [GitHub](https://github.com/v4rakh/docker-filebin) or [Docker Hub](https://hub.docker.com/r/varakh/filebin). Visit project on [GitHub](https://github.com/v4rakh/docker-filebin)
or [Docker Hub](https://hub.docker.com/r/varakh/filebin).
## Getting started ## Getting started
The recommended way to get started is to use the example `docker-compose.yml` file and make yourself familiar with the environment variables which can be set. Defaults should do as a starting point. The recommended way to get started is to use the example `docker-compose.yml` file and make yourself familiar with the
environment variables which can be set. Defaults should do as a starting point.
_Be sure to read persisting volumes_ section and execute the required command. _Be sure to read persisting volumes_ section and execute the required command.
Default database is PostgreSQL. Other databases are supported and can be configured via exposed environment variables. Please refer to the original documentation of the application for further details. PHP modules for MySQL are included in the image. Default database is PostgreSQL. Other databases are supported and can be configured via exposed environment variables.
Please refer to the original documentation of the application for further details. PHP modules for MySQL are included in
the image.
After your database and the application docker container is up and running, add a first user by executing a command within the docker container: After your database and the application docker container is up and running, add a first user by executing a command
within the docker container:
``` ```
docker exec -it filebin_app /bin/sh docker exec -it filebin_app /bin/sh
@ -26,7 +31,8 @@ You'll probably want the `uploads/` folder to be persistent across container res
Here's an example on how to persist the `data/uploads/` folder of the application. Here's an example on how to persist the `data/uploads/` folder of the application.
* Create folder: `mkdir -p ./filebin_data` * Create folder: `mkdir -p ./filebin_data`
* Afterwards, adjust permissions so that the folder can be used within the docker container: `chown -R 65534:102 <host-mount>` (`nobody:nginx`) * Afterwards, adjust permissions so that the folder can be used within the docker
container: `chown -R 65534:102 <host-mount>` (`nobody:nginx`)
* Reference the folder as a docker volume, e.g. with `./filebin_data:/var/www/data/uploads` * Reference the folder as a docker volume, e.g. with `./filebin_data:/var/www/data/uploads`
### Cron jobs ### Cron jobs
@ -35,33 +41,41 @@ Application specific cron jobs are run every 15 minutes.
### Advanced configuration: customize non-exposed configuration variables ### Advanced configuration: customize non-exposed configuration variables
If you need to make frequent changes or adapt configuration values which If you need to make frequent changes or adapt configuration values which are not exposed as environment variables, you
are not exposed as environment variables, you probably want the `config-local.php` and `database.php` or the entire `config/` folder on the hosts file system. probably want the `config-local.php` and `database.php` or the entire `config/` folder on the hosts file system.
In order to do so, first _extract_ the current configuration, e.g. by extracting only the required `.php` files or by extracting the entire `config/` folder. In this example we'll just use entire folder. In order to do so, first _extract_ the current configuration, e.g. by extracting only the required `.php` files or by
extracting the entire `config/` folder. In this example we'll just use entire folder.
``` ```
docker cp filebin_app:/var/www/application/config/ ./filebin_config docker cp filebin_app:/var/www/application/config/ ./filebin_config
chown -R 65534:102 ./filebin_config chown -R 65534:102 ./filebin_config
``` ```
Add the `./filebin_config` folder as a host bind to the application docker container, e.g. with `./filebin_config:/var/www/application/config/` Add the `./filebin_config` folder as a host bind to the application docker container, e.g.
with `./filebin_config:/var/www/application/config/`
### Available environment variables ### Available environment variables
Please have a look into `Dockerfile` for available environment variables, they're all exposed there. Please have a look into `Dockerfile` for available environment variables, they're all exposed there.
All variables to FileBin itself should be self-explaining. You should also be familiar with the `php.ini` variables. They're only inserted on build, if you like to increase the file limit above the used php variable values of this image, you'll need to rebuild the docker image. All variables to FileBin itself should be self-explaining. You should also be familiar with the `php.ini` variables.
They're only inserted on build, if you like to increase the file limit above the used php variable values of this image,
you'll need to rebuild the docker image.
There are two environment variables introduced by this image: There are two environment variables introduced by this image:
* `RECONFIGURE`: If all defined environment should be re-applied to the provided `.tpl` files within the image. You probably want this to be `1` unless you mounted your `config/` folder on the host * `RECONFIGURE`: If all defined environment should be re-applied to the provided `.tpl` files within the image. You
* `MIGRATE`: Calls FileBin database migration every time the container is started and updates dependencies via `composer` probably want this to be `1` unless you mounted your `config/` folder on the host
* `SMTP_ENABLED`: Set to `true` in order to enable sending mails via an external SMTP server, set to `false` to use PHP's internal mailer, see other `SMTP_` variables in the `Dockerfile` * `MIGRATE`: Calls FileBin database migration every time the container is started and updates dependencies
via `composer`
* `SMTP_ENABLED`: Set to `true` in order to enable sending mails via an external SMTP server, set to `false` to use
PHP's internal mailer, see other `SMTP_` variables in the `Dockerfile`
### Setting up a nginx proxy ### Setting up a nginx proxy
Be sure to set the environment variable `BASE_URL` to the same where you expose it, e.g. `BASE_URL=https://fb.domain.tld`. Be sure to set the environment variable `BASE_URL` to the same where you expose it,
e.g. `BASE_URL=https://fb.domain.tld`.
An example nginx configuration might look like the following. An example nginx configuration might look like the following.
@ -115,8 +129,8 @@ Just use a newly released image version. Configuration should be compatible.
Backup the host binds for `uploads/` and the database manually. Backup the host binds for `uploads/` and the database manually.
If you're using the provided `docker-compose.yml` file you probably can do something like the following and afterwards backup the extracted file from `/tmp` of your host system: If you're using the provided `docker-compose.yml` file you probably can do something like the following and afterwards
backup the extracted file from `/tmp` of your host system:
``` ```
docker exec filebin_db bash -c "/usr/bin/pg_dumpall -U fb|gzip -c > /filebin_db.sql.gz"; docker exec filebin_db bash -c "/usr/bin/pg_dumpall -U fb|gzip -c > /filebin_db.sql.gz";