diff --git a/productivity/planka/.gitignore b/productivity/planka/.gitignore new file mode 100644 index 0000000..efe58f6 --- /dev/null +++ b/productivity/planka/.gitignore @@ -0,0 +1,3 @@ +planka.env +planka-db.env + diff --git a/productivity/planka/README.md b/productivity/planka/README.md new file mode 100644 index 0000000..b074ed3 --- /dev/null +++ b/productivity/planka/README.md @@ -0,0 +1,37 @@ +# Planka +Self hosted Kanban organizer. + +## Setup + +### General +1. (If not using checked in Dockerfile) Use the Dockerfile from Planka: +``` +curl -L https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml -o ./docker-compose.yml +``` + +2. This is what I changed from their base Dockerfile to get a runnable container when you checkout the repo: +- Convert exposed ports to traefik labels for the main container. +- Introduce Traefik network + create planka network for the containers to talk on. +- Convert volumes to bind mounts on disk. +- Convert to using env files instead of manually providing env vars. + +3. Create Env files +Copy `planka.env.example` to `planka.env`, and `planka-db.env.example` to `planka-db.env` and fill with data, observing the following: +- Update `BASE_URL` to point to vanity URL. Optionally generate a `SECRET_KEY` as well. +- The `POSTGRES_DB` value in `planka-db.env` should match the database specified by `DATABASE_URL` in `planka.env`. + +4. Start just the db +``` +docker compose up -d postgres +``` + +5. Create Admin User +``` +docker compose run --rm planka npm run db:create-admin-user +``` + +6. Start the rest of Dockerfile +``` +docker compose up -d +``` + diff --git a/productivity/planka/docker-compose.yml b/productivity/planka/docker-compose.yml new file mode 100644 index 0000000..129c621 --- /dev/null +++ b/productivity/planka/docker-compose.yml @@ -0,0 +1,46 @@ +networks: + traefik: + external: true + planka: + driver: bridge + +services: + planka: + image: ghcr.io/plankanban/planka:2.0.0-rc.2 + container_name: planka + restart: on-failure + networks: + - planka + - traefik + volumes: + - /pwspool/software/planka/favicons:/app/public/favicons + - /pwspool/software/planka/user-avatars:/app/public/user-avatars + - /pwspool/software/planka/background-images:/app/public/background-images + - /pwspool/software/planka/attachments:/app/private/attachments + env_file: + - planka.env + depends_on: + postgres: + condition: service_healthy + labels: + - traefik.http.routers.planka.rule=Host(`todo.whitney.rip`) + - traefik.http.routers.planka.tls=true + - traefik.http.routers.planka.tls.certresolver=lets-encrypt + - traefik.http.services.planka.loadbalancer.server.port=1337 + + postgres: + image: postgres:16-alpine + container_name: planka-db + restart: on-failure + networks: + - planka + volumes: + - /pwspool/software/planka/data:/var/lib/postgresql/data + env_file: + - planka-db.env + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] + interval: 10s + timeout: 5s + retries: 5 + diff --git a/productivity/planka/planka-db.env.example b/productivity/planka/planka-db.env.example new file mode 100644 index 0000000..79807d4 --- /dev/null +++ b/productivity/planka/planka-db.env.example @@ -0,0 +1,3 @@ +# Planka DB Env Vars +POSTGRES_DB=planka +POSTGRES_HOST_AUTH_METHOD=trust diff --git a/productivity/planka/planka.env.example b/productivity/planka/planka.env.example new file mode 100644 index 0000000..34274ef --- /dev/null +++ b/productivity/planka/planka.env.example @@ -0,0 +1,5 @@ +# Planka Env Vars +BASE_URL=https://subdomain.example.com +DATABASE_URL=postgresql://postgres@postgres/planka +SECRET_KEY=notsecretkey +LOG_LEVEL=warn