self host planka error on start
itzdrli opened this issue · comments
I was trying to deploy production version of planka with docker, this is what I did:
mkdir planka # (not in /opt/planka)
curl -L https://raw.githubusercontent.com/plankanban/planka/master/docker-compose.yml -o /opt/planka/docker-compose.yml # from doc
openssl rand -hex 64 # then pasted in docker-compose.yml, also edited BASE_URL
docker compose up -d
This is what happend:
I opened http://myserverip:3000
, then it loaded but nothing appeared:
but the title of this tab showed up:
Then I checked the log of container planka-planka-1
via portainer:
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error: getaddrinfo ENOTFOUND postgres
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'postgres'
}
Node.js v18.20.2
Running on Debian 12, arm64 platform,
docker:
Client: Docker Engine - Community
Version: 26.1.0
API version: 1.45
Go version: go1.21.9
Git commit: 9714adc
Built: Mon Apr 22 17:06:59 2024
OS/Arch: linux/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.1.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.9
Git commit: c8af8eb
Built: Mon Apr 22 17:06:59 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.31
GitCommit: e377cd56a71523140ca6ae87e30244719194a521
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Thanks
Update: acts same after I have set everything correctly by following the document (docker-compose.yml
at /opt/planka
)
Without seeing your compose file, it's nearly impossible to tell what is going wrong
Oh, forgot to post it,
version: '3'
services:
planka:
image: ghcr.io/plankanban/planka:latest
restart: on-failure
volumes:
- user-avatars:/app/public/user-avatars
- project-background-images:/app/public/project-background-images
- attachments:/app/private/attachments
ports:
- 3000:1337
environment:
- BASE_URL=http://0.0.0.0:3000
- DATABASE_URL=postgresql://postgres@postgres/planka
- SECRET_KEY=blahblah
# - TRUST_PROXY=0
# - TOKEN_EXPIRES_IN=365 # In days
# related: https://github.com/knex/knex/issues/2354
# As knex does not pass query parameters from the connection string we
# have to use environment variables in order to pass the desired values, e.g.
# - PGSSLMODE=<value>
# Configure knex to accept SSL certificates
# - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
- DEFAULT_ADMIN_EMAIL=admin@itzdrli.com # Do not remove if you want to prevent this user from being edited/deleted
- DEFAULT_ADMIN_PASSWORD=Itzdrli-51132
- DEFAULT_ADMIN_NAME=Letian Li
- DEFAULT_ADMIN_USERNAME=itzdrli
# - OIDC_ISSUER=
# - OIDC_CLIENT_ID=
# - OIDC_CLIENT_SECRET=
# - OIDC_SCOPES=openid email profile
# - OIDC_ADMIN_ROLES=admin
# - OIDC_EMAIL_ATTRIBUTE=email
# - OIDC_NAME_ATTRIBUTE=name
# - OIDC_USERNAME_ATTRIBUTE=preferred_username
# - OIDC_ROLES_ATTRIBUTE=groups
# - OIDC_IGNORE_USERNAME=true
# - OIDC_IGNORE_ROLES=true
# - OIDC_ENFORCED=true
# Email Notifications (https://nodemailer.com/smtp/)
- SMTP_HOST=smtppro.zoho.com
- SMTP_PORT=587
- SMTP_SECURE=true
- SMTP_USER=admin@itzdrli.com
- SMTP_PASSWORD=Dlmc-51132
- SMTP_FROM="Board" <admin@itzdrli.com>
# - SLACK_BOT_TOKEN=
# - SLACK_CHANNEL_ID=
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:14-alpine
restart: on-failure
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
interval: 10s
timeout: 5s
retries: 5
volumes:
user-avatars:
project-background-images:
attachments:
db-data:
No problem
Please set your the BASE_URL to http://your-server-ip:3000 or http://your-server-hostname:3000
It's working now, much appreciated.