This is a lightweight, secure template for running Wakapi (an open-source alternative to WakaTime) on your machine. It uses PostgreSQL and Cloudflare Tunnel for convenient access from the WAN without port forwarding.
Wakapi is an open-source tool that helps you track the time you spend coding in different programming languages and on different projects.
- Docker Secrets: Passwords and tokens are stored using Docker Secrets instead of environment variables, which is good practice.
- Cloudflare Tunnel: Don't worry about port forwarding and SSL certificates β Cloudflare manages the boilerplate.
- Easy adjustments: Just one .env file to set everything up.
- Create a directory on your server and place the .env and docker-compose.yml files there.
- Open the .env file in your editor.
- Use a password generator service (such as this) to fill in the
WAKAPI_PASSWORD_SALTandWAKAPI_DB_PASSWORDfields. I recommend not using special symbols. - If you have an SMTP server, specify the
WAKAPI_MAIL_SMTP_PASSfield. - Leave the
WAKAPI_ALLOW_SIGNUPfield turned on. However, since you are registering an account, it is better to turn it off. - If you don't have a domain, go to Cloudflare. It's easy to understand how it works; there are a lot of videos on YouTube explaining it. You have to link your domain to your account.
- Set up a tunnel in your Cloudflare dashboard and retrieve your token. There is a good documentation page.
- Specify your token in the
CLOUDFLARE_TUNNEL_TOKENfield. - For best results, link the tunnel to a subdomain. This allows you to specify the full URL to the homepage in the
WAKAPI_PUBLIC_URLfield. - Run the
docker compose up -d(orpodman compose up -d) command to start the stack. - Well done!
- Run the
docker compose downcommand to stop the stack (orpodman compose down). - Well done!