inital commit

This commit is contained in:
Raphael Martin 2023-11-24 19:25:04 +01:00
commit a443fc636b
6 changed files with 146 additions and 0 deletions

14
.env.sample Normal file
View File

@ -0,0 +1,14 @@
ADMIN_EMAIL=admin@email
ADMIN_PASSWORD=admin
ADMIN_NAME=admin
ADMIN_USERNAME=admin
SECRET_KEY=yoursuperstrongsecretkey
PROJECT_NAME=sample
PROJECT_URL=planka.localhost
TRAEFIK_NETWORK=traefik_net
PROJECT_DATA=./data

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.env
data/*

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2023 docker
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

42
README.md Normal file
View File

@ -0,0 +1,42 @@
# traefik planka
### get started
add a .env file
sample .env:
# .env
ADMIN_EMAIL=admin@email
ADMIN_PASSWORD=admin
ADMIN_NAME=admin
ADMIN_USERNAME=admin
SECRET_KEY=yoursecretsuperstrongkey
PROJECT_NAME=sample
PROJECT_URL=planka.localhost
# the traefik network you want to use
TRAEFIK_NETWORK=traefik_net
PROJECT_DATA=./data
change the docker-compsoe.yml
#- "DEFAULT_ADMIN_PASSWORD=${ADMIN_PASSWORD}"
#- "DEFAULT_ADMIN_NAME=${ADMIN_NAME}"
#- "DEFAULT_ADMIN_USERNAME=${ADMIN_USERNAME}"
to
- "DEFAULT_ADMIN_PASSWORD=${ADMIN_PASSWORD}"
- "DEFAULT_ADMIN_NAME=${ADMIN_NAME}"
- "DEFAULT_ADMIN_USERNAME=${ADMIN_USERNAME}"
then execute init
after the first run you can remove the ADMIN_PASSWORD, ADMIN_NAME and ADMIN_USERNAME from your .env
and comment the three lines in the docker-compose.yml again or rebase with git.

66
docker-compose.yml Normal file
View File

@ -0,0 +1,66 @@
version: '1'
networks:
default:
name: "${TRAEFIK_NETWORK}"
external: true
db:
name: "${PROJECT_NAME}_planka_db_net"
external: false
services:
planka:
container_name: "${PROJECT_NAME}_planka"
image: "ghcr.io/plankanban/planka:latest"
user: "1000"
command: >
bash -c
"for i in `seq 1 30`; do
./start.sh &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 seconds...\";
sleep 5;
done; (exit $$s)"
restart: "unless-stopped"
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/user-avatars:/app/public/user-avatars"
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/project-background-images:/app/public/project-background-images"
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/attachments:/app/private/attachments"
networks:
- "db"
environment:
- "BASE_URL=https://${PROJECT_URL}"
- "TRUST_PROXY=0"
- "DATABASE_URL=postgresql://postgres@db/planka"
- "SECRET_KEY=${SECRET_KEY}"
# Can be removed after installation
- "DEFAULT_ADMIN_EMAIL=${ADMIN_EMAIL}" # Do not remove if you want to prevent this user from being edited/deleted
- "DEFAULT_ADMIN_PASSWORD=${ADMIN_PASSWORD}"
- "DEFAULT_ADMIN_NAME=${ADMIN_NAME}"
- "DEFAULT_ADMIN_USERNAME=${ADMIN_USERNAME}"
depends_on:
- "db"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=true"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
- "traefik.http.routers.${PROJECT_NAME}_planka.rule=Host(`${PROJECT_URL}`)"
- "traefik.http.services.${PROJECT_NAME}_planka.loadbalancer.server.port=1337"
- "traefik.http.routers.${PROJECT_NAME}_planka.entrypoints=websecure"
- "traefik.http.routers.${PROJECT_NAME}_planka.tls=true"
db:
container_name: "${PROJECT_NAME}_planka_db"
image: "postgres:alpine"
restart: "unless-stopped"
networks:
- "db"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=false"
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/db:/var/lib/postgresql/data"
environment:
- "POSTGRES_DB=planka"
- "POSTGRES_HOST_AUTH_METHOD=trust"

12
init Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
source ./.env
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/user-avatars
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/project-background-images
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/attachments
mkdir -p ${PROJECT_DATA}/${PROJECT_NAME}-planka/db
docker network create $TRAEFIK_NETWORK
docker compose up -d