diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..8622e21 --- /dev/null +++ b/.env.sample @@ -0,0 +1,37 @@ +BASEDIR= +INTRANET= + +BASE_URL=http://yourdomain:3000 + +# generate with: openssl rand -hex 64 +SECRET_KEY=notsecretkey + +# Do not remove if you want to prevent this user from being edited/deleted +DEFAULT_ADMIN_EMAIL=demo@demo.demo +DEFAULT_ADMIN_PASSWORD=demo +DEFAULT_ADMIN_NAME=Demo Demo +DEFAULT_ADMIN_USERNAME=demo + +# 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= + +# Configure knex to accept SSL certificates +# KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false + +# 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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/README.md b/README.md index 3241e57..0d3cbe8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ -# compose-planka +# Basic Planka docker-compose config +* can be run on single node setup or in swarm +## howto +### single node +#### start container +```bash +docker compose up -d +``` + +#### stop container (and remove) +```bash +docker compose down +``` + +#### view logs +```bash +docker compose logs -f +``` + +#### reload config +```bash +docker compose restart +``` + +### swarm +#### start aka deploy +```bash +docker stack deploy -c docker-compose.yml planka +``` + +#### stop container aka service +```bash +docker stack rm planka +``` + +#### view logs +```bash +docker service logs planka_planka -f +``` + +#### reload config +```bash +docker service update planka_planka --force +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4c5138e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,60 @@ +# https://docs.planka.cloud +# https://github.com/plankanban/planka +# https://docs.planka.cloud/docs/installation/docker/production_version +--- +version: '3' + +services: + planka: + image: ghcr.io/plankanban/planka:latest + container_name: planka + restart: on-failure + env_file: + - .env + volumes: + - ${BASEDIR:-.}/files/user-avatars:/app/public/user-avatars + - ${BASEDIR:-.}/files/project-background-images:/app/public/project-background-images + - ${BASEDIR:-.}/files/attachments:/app/private/attachments + ports: + - 3000:1337 + depends_on: + postgres: + condition: service_healthy + deploy: + replicas: 1 + placement: + max_replicas_per_node: 1 + update_config: + parallelism: 1 + delay: 10s + environment: + - DATABASE_URL=postgresql://postgres@postgres/planka + + plankadb: + image: postgres:14-alpine + container_name: plankadb + restart: on-failure + volumes: + - ${BASEDIR:-.}/files/db-data:/var/lib/postgresql/data + network: + - backend + environment: + - POSTGRES_DB=planka + - POSTGRES_HOST_AUTH_METHOD=trust + deploy: + replicas: 1 + placement: + max_replicas_per_node: 1 + update_config: + parallelism: 1 + delay: 10s + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] + interval: 10s + timeout: 5s + retries: 5 + +networks: + backend: + name: ${INTRANET:-backend} + external: true