Add Docker Compose setup for self-hosted Shlink on Coolify
This commit is contained in:
17
.env.example
Normal file
17
.env.example
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Your short URL domain (e.g. s.example.com)
|
||||||
|
DEFAULT_DOMAIN=s.example.com
|
||||||
|
|
||||||
|
# Set to false if running without TLS termination
|
||||||
|
IS_HTTPS_ENABLED=true
|
||||||
|
|
||||||
|
# Database
|
||||||
|
DB_NAME=shlink
|
||||||
|
DB_USER=shlink
|
||||||
|
DB_PASSWORD=change_me_strong_password
|
||||||
|
|
||||||
|
# Generate a UUID or random string for the initial API key
|
||||||
|
# e.g.: openssl rand -hex 32
|
||||||
|
INITIAL_API_KEY=change_me_api_key
|
||||||
|
|
||||||
|
# Timezone (https://www.php.net/manual/en/timezones.php)
|
||||||
|
TIMEZONE=UTC
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.env
|
||||||
18
README.md
18
README.md
@@ -0,0 +1,18 @@
|
|||||||
|
# Shlink — self-hosted URL shortener
|
||||||
|
|
||||||
|
Deployed on [Coolify](https://coolify.io) via Docker Compose.
|
||||||
|
|
||||||
|
## Coolify setup
|
||||||
|
|
||||||
|
1. Create a new resource → **Docker Compose** → point to this repo.
|
||||||
|
2. In the Coolify environment variables UI, set the values from `.env.example`:
|
||||||
|
- `DEFAULT_DOMAIN` — your short URL domain (e.g. `s.example.com`)
|
||||||
|
- `DB_PASSWORD` — strong random password
|
||||||
|
- `INITIAL_API_KEY` — initial API key (`openssl rand -hex 32`)
|
||||||
|
- `TIMEZONE` — your timezone
|
||||||
|
3. Add a domain in Coolify pointing to port `8080`.
|
||||||
|
4. Deploy.
|
||||||
|
|
||||||
|
## Shlink Web UI
|
||||||
|
|
||||||
|
Optionally connect [shlink-web-client](https://app.shlink.io) to your instance using your domain and API key.
|
||||||
|
|||||||
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
services:
|
||||||
|
shlink:
|
||||||
|
image: shlinkio/shlink:stable
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
DEFAULT_DOMAIN: ${DEFAULT_DOMAIN}
|
||||||
|
IS_HTTPS_ENABLED: ${IS_HTTPS_ENABLED:-true}
|
||||||
|
DB_DRIVER: postgres
|
||||||
|
DB_HOST: db
|
||||||
|
DB_PORT: 5432
|
||||||
|
DB_NAME: ${DB_NAME:-shlink}
|
||||||
|
DB_USER: ${DB_USER:-shlink}
|
||||||
|
DB_PASSWORD: ${DB_PASSWORD}
|
||||||
|
INITIAL_API_KEY: ${INITIAL_API_KEY}
|
||||||
|
TIMEZONE: ${TIMEZONE:-UTC}
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${DB_NAME:-shlink}
|
||||||
|
POSTGRES_USER: ${DB_USER:-shlink}
|
||||||
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- db_data:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-shlink} -d ${DB_NAME:-shlink}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db_data:
|
||||||
Reference in New Issue
Block a user