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

[feature] Dockerized every part & minor bug fixes #10

Closed ItzDerock closed 2 years ago

ItzDerock commented 2 years ago

I've created 2 docker images, one for the frontend/static + backend proxy, and the backend.

Frontend The frontend docker image (client/Dockerfile) will build the react app in a node.js v16 container, and then copy it to a nginx container which will serve the built files. It will also proxy requests to the backend (defined in the BACKEND_URL environment variable)

Backend The backend docker image (server/Dockerfile) will run the node.js application and expose the running port. It will automatically run prisma db push on start, as well as changing the schema.prisma database type to DATABASE_TYPE environment variable.

You can test this out by cloning my repo, and running docker-compose build then docker-compose up The site should be accessible at http://localhost:80

Frontend docker image is 60mb and I have a built version tagged docker.derock.dev/pckd/client Backend docker image is 400mb and a built version is tagged docker.derock.dev/pckd/server (when/if this pr gets merged, ill move the images to docker hub)

netlify[bot] commented 2 years ago

Deploy Preview for pckd ready!

Name Link
Latest commit 3252518f0c4176a0e1c949ff4817b619bdc61b4a
Latest deploy log https://app.netlify.com/sites/pckd/deploys/625041d5f3ebfb00093a681c
Deploy Preview https://deploy-preview-10--pckd.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

ItzDerock commented 2 years ago

Still having issues with stats showing null and invalid dates, not sure if this is a docker issue or if it is something in the code. image

Also there seems to be a lot of excess scrollbars, due to overflow-y: scroll