mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-11 07:32:57 +03:00
feat: add option to disable Caddy in the Docker container
This commit is contained in:
@@ -4,7 +4,7 @@ id: environment-variables
|
||||
|
||||
# Environment Variables
|
||||
|
||||
Below are all the environment variables supported by Pocket ID. These should be configured in your `.env ` file.
|
||||
Below are all the environment variables supported by Pocket ID. These should be configured in your `.env ` file.
|
||||
|
||||
Be cautious when modifying environment variables that are not recommended to change.
|
||||
|
||||
@@ -21,5 +21,6 @@ Be cautious when modifying environment variables that are not recommended to cha
|
||||
| `INTERNAL_BACKEND_URL` | `http://localhost:8080` | no | The URL where the backend is accessible. |
|
||||
| `GEOLITE_DB_PATH` | `data/GeoLite2-City.mmdb` | no | The path where the GeoLite2 database should be stored. |
|
||||
| `CADDY_PORT` | `80` | no | The port on which Caddy should listen. Caddy is only active inside the Docker container. If you want to change the exposed port of the container then you sould change this variable. |
|
||||
| `CADDY_DISABLED` | `false` | no | Whether Caddy should be disabled inside the Docker container. If disabled, you must configure your reverse proxy to correctly map all paths. Refer to the [official Caddyfile](https://github.com/pocket-id/pocket-id/blob/main/reverse-proxy/Caddyfile) for guidance. |
|
||||
| `PORT` | `3000` | no | The port on which the frontend should listen. |
|
||||
| `BACKEND_PORT` | `8080` | no | The port on which the backend should listen | |
|
||||
| `BACKEND_PORT` | `8080` | no | The port on which the backend should listen |
|
||||
|
||||
@@ -4,13 +4,17 @@ node frontend/build &
|
||||
echo "Starting backend..."
|
||||
cd backend && ./pocket-id-backend &
|
||||
|
||||
echo "Starting Caddy..."
|
||||
if [ "$CADDY_DISABLED" != "true" ]; then
|
||||
echo "Starting Caddy..."
|
||||
|
||||
# Check if TRUST_PROXY is set to true and use the appropriate Caddyfile
|
||||
if [ "$TRUST_PROXY" = "true" ]; then
|
||||
caddy start --adapter caddyfile --config /etc/caddy/Caddyfile.trust-proxy &
|
||||
# Check if TRUST_PROXY is set to true and use the appropriate Caddyfile
|
||||
if [ "$TRUST_PROXY" = "true" ]; then
|
||||
caddy start --adapter caddyfile --config /etc/caddy/Caddyfile.trust-proxy &
|
||||
else
|
||||
caddy start --adapter caddyfile --config /etc/caddy/Caddyfile &
|
||||
fi
|
||||
else
|
||||
caddy start --adapter caddyfile --config /etc/caddy/Caddyfile &
|
||||
echo "Caddy is disabled. Skipping..."
|
||||
fi
|
||||
|
||||
wait
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user