mirror of https://github.com/bastienwirtz/homer
Added feature for subfolder hosting
By setting the SUBFOLDER env var, you can host Homer in a subfolder behind a reverse proxy.pull/421/head
parent
af0a6e89c9
commit
caf5fae8a8
|
@ -83,6 +83,10 @@ docker run -d \
|
||||||
|
|
||||||
Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner (`docker run -e "UID=1000" -e "GID=1000" [...]`).
|
Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner (`docker run -e "UID=1000" -e "GID=1000" [...]`).
|
||||||
|
|
||||||
|
## Host in subfolder
|
||||||
|
|
||||||
|
If you would like to host Homer in a subfolder, for e.g. behind a reverse proxy, supply the name of subfolder by using the `SUBFOLDER` env var.
|
||||||
|
|
||||||
### Using docker-compose
|
### Using docker-compose
|
||||||
|
|
||||||
The `docker-compose.yml` file must be edited to match your needs.
|
The `docker-compose.yml` file must be edited to match your needs.
|
||||||
|
|
|
@ -11,5 +11,11 @@ fi
|
||||||
# Install default config if no one is available.
|
# Install default config if no one is available.
|
||||||
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
|
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
|
||||||
|
|
||||||
|
# Create symbolic link for hosting in subfolder.
|
||||||
|
if [[ -n "${SUBFOLDER}" ]]; then
|
||||||
|
ln -s /www "/www/$SUBFOLDER"
|
||||||
|
chown -h $USER:$GROUP "/www/$SUBFOLDER"
|
||||||
|
fi
|
||||||
|
|
||||||
chown -R $UID:$GID /www/assets
|
chown -R $UID:$GID /www/assets
|
||||||
exec su-exec $UID:$GID darkhttpd /www/ --no-listing --port "$PORT"
|
exec su-exec $UID:$GID darkhttpd /www/ --no-listing --port "$PORT"
|
||||||
|
|
Loading…
Reference in New Issue