Setting Up Docker Container
Experience with Docker, domains and web hosting is highly recommended for this method. Proceed only if you know what you are doing!
Prerequisites
Getting Started
-
Clone the repository
git clone https://github.com/spoo-me/url-shortener.git
-
Rename the
.env.example
file to.env
mv .env.example .env
-
Fill in the environment variables in the
.env
file with the values generated beforeMONGODB_URI= CONTACT_WEBHOOK= URL_REPORT_WEBHOOK=
The
MONGODB_URI
,CONTACT_WEBHOOK
, andURL_REPORT_WEBHOOK
environment variables are sensitive and should not be shared with anyone. The values of these environment variables were generated in the previous steps. In this method, you can also set yourMONGODB_URI
tomongodb://mongo:27017
. -
Modify the code base to your needs, like adding custom SEO, analytics, etc. in your favorite code editor.
-
Build the Docker container
docker-compose up --build
-
Congratulations 🎉 your self-hosted url shortener is ready, access it at http://localhost:8000