Just-Moh-it/Pckd

Prebuilt Docker image

petrleocompel opened this issue · 4 comments

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.

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

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

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

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 🥳