Just-Moh-it / Pckd

The ⚡️ analytics-intensive, self-hostable link-shortener with a beautiful UI | AKA free bit.ly alternative 🚀
https://docs.pckd.me/
MIT License
783 stars 95 forks source link

Prebuilt Docker image #32

Open petrleocompel opened 2 years ago

petrleocompel commented 2 years ago

For further use docker images would be amazing (that we do not have to build each version on our machnies).

So I made an example (even with 2 containers - better than nothing) in fork https://github.com/petrleocompel/Pckd

Result = 2 images https://hub.docker.com/r/petrleocompel/pckd-client https://hub.docker.com/r/petrleocompel/pckd-server

Used Github Actions + 2 Actions secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN. How to make a DockerHub token -> https://docs.docker.com/docker-hub/access-tokens/

I can make a pull request (only thing to tweak is change name of docker images).

Otherwise it is done.

petrleocompel commented 2 years ago

My tweaked yaml after that

version: "3"

services:
  server:
    image: petrleocompel/pckd-server
    volumes:
      - ./logs:/home/node/app/logs
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@db/pckd
      - DATABASE_TYPE=postgres
      - JWT_SECRET= verysecurestring
      - IPREGISTRY_API_KEY=f1ntkcjoqaazglj7
    depends_on:
      - db

  frontend:
    image: petrleocompel/pckd-client
    ports:
      - 80:80
    environment:
      - BACKEND_URL=http://server:4000

  db:
    image: postgres:13-alpine
    volumes:
      - ./db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=pckd
Just-Moh-it commented 2 years ago

Thanks a lot for the contribution. This has been merged in #33 🎉

Just-Moh-it commented 2 years ago

Currently having some problems with the docker login... A fix for later

petrleocompel commented 2 years ago

Should not be that hard to fix this -> just go by this guide https://github.com/docker/login-action#docker-hub -> https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token

Create token on https://hub.docker.com/settings/security

And define on https://github.com/PckdHQ/Pckd/settings/secrets/actions those secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN.

We should be good to go 🥳