Yourls - Your Own URL Shortener https://yourls.org/
5.2K
Using a Docker Container to run a YOURLS instance with CentOS, Nginx and fpm.
Image available at Docker Hub.
Visit YOURLS official website for more information.
This repository is a fork from tsgoff/docker-yourls.
curl -ssl https://get.docker.com | sh
[suggested]
curl -L https://github.com/docker/compose/releases/download/1.6.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose
Create a file named docker-compose.yml
vi docker-compose.yml
Then paste
yourls:
image: gabrielrf/docker-yourls
environment:
- YOURL_USER=admin
- YOURL_PASSWORD=PASSWORD
- YOURLS_SITE=http://DOMAIN.TLD
- YOURLS_URL_CONVERT=62
links:
- yourlsmysql:mysql
ports:
- 80:80
volumes:
- /home/plugins:/usr/share/host
yourlsmysql:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=PASSWORD
- MYSQL_DATABASE=yourls
Set YOURL_PASSWORD, YOURLS_SITE and MYSQL_ROOT_PASSWORD as you prefer.
Finally, run
docker-compose up
YOURLS must be available on the port 80 of your machine. It will be installed when you first run it and must be fine after that.
By now, your container must be up and running properly! Easy, huh?
To run it as a daemon, simply add a -d to the end of the command
docker-compose up -d
YOURLS_SITEYour (hopefully short) domain URL, no trailing slash, lowercase. If you pick the non-www version of your domain, don't use the www version in your browser (and vice-versa). Example: define( 'YOURLS_SITE', 'http://ozh.in' );
YOURL_USERUser or Users allowed to log in.
YOURL_PASSWORDPassword of the user or users listed on YOURL_USER.
YOURLS_URL_CONVERT optionalURL shortening method. Options are 36 and 62.
Base 36 (default) encoding uses 0123456789abcdefghijklmnopqrstuvwxyz.
Base 62 encoding uses 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
REDIRECT_MAIN_PAGE optionalThe webpage users will be redirected in case of a misspelled link or and attempt to access the url defined on YOURLS_SITE.
HTTPS optionalIf true users will only be able to visit links using https://
To turn this option off, simply remove it from docker-compose.yml
FQDN optionalParameter present on the file /etc/nginx/conf.d/default.conf
SSL_SELFSIGNED optionalUsed to generate self signed certificates.
SSL_PROTOCOLS optionalDepends on SSL_SELFSIGNED.
Protocols used on self signed certificates.
SSL_CIPHERS optionalDepends on SSL_SELFSIGNED.
SSL ciphers used.
DB_PREFIX optionalPrefix of every database. Default value is root for MYSQL and postgres for PostgreSQL.
DB_HOST optionalHost used for external databases.
DB_USER optionalDepends on DB_HOST. User allowed to log on databases. Default is yourls.
DB_PASSWORD optionalDepends on DB_HOST. Password to access the database. It can (I suggest it must) be different from YOURL_PASSWORD.
DB_NAME optionalDepends on DB_HOST. Database name.
YOURLS_PUB_DUMMY optionalDo not use this if using REDIRECT_MAIN_PAGE. Creates a public dummy site.
Content type
Image
Digest
Size
200.4 MB
Last updated
over 10 years ago
docker pull gabrielrf/docker-yourls