Merge pull request #1 from linuxserver/initial-ish

This commit is contained in:
Adam 2024-09-12 15:36:02 +01:00 committed by GitHub
commit 8fc561cd7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 38 additions and 12 deletions

View File

@ -15,6 +15,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
build-base \
npm \
py3-setuptools \
python3-dev && \
echo "**** install planka ****" && \
if [ -z ${PLANKA_RELEASE+x} ]; then \
@ -55,7 +56,8 @@ LABEL maintainer="thespad"
RUN \
apk add --no-cache \
nodejs && \
nodejs \
postgresql16-client && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version
COPY --from=buildstage /build/server/ /app

View File

@ -15,6 +15,7 @@ RUN \
apk add --no-cache --virtual=build-dependencies \
build-base \
npm \
py3-setuptools \
python3-dev && \
echo "**** install planka ****" && \
if [ -z ${PLANKA_RELEASE+x} ]; then \
@ -55,7 +56,8 @@ LABEL maintainer="thespad"
RUN \
apk add --no-cache \
nodejs && \
nodejs \
postgresql16-client && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version
COPY --from=buildstage /build/server/ /app

4
Jenkinsfile vendored
View File

@ -31,8 +31,8 @@ pipeline {
PR_DOCKERHUB_IMAGE = 'lspipepr/planka'
DIST_IMAGE = 'alpine'
MULTIARCH='true'
CI='true'
CI_WEB='true'
CI='false'
CI_WEB='false'
CI_PORT='1337'
CI_SSL='false'
CI_DELAY='60'

View File

@ -37,7 +37,6 @@ Find us at:
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/planka.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/planka)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/planka.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/planka)
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-planka%2Fjob%2Fmain%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-planka/job/main/)
[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fplanka%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/planka/latest/index.html)
[Planka](https://github.com/plankanban/planka/) is an elegant open source project tracking tool.
@ -91,7 +90,7 @@ services:
- PGID=1000
- TZ=Etc/UTC
- BASE_URL=https://planka.example.com
- DATABASE_URL=postgresql://user:password@planka-db/planka
- DATABASE_URL=postgresql://user:password@planka-db:5432/planka
- SECRET_KEY=notasecretkey
- TRUST_PROXY=0
volumes:
@ -110,7 +109,7 @@ docker run -d \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e BASE_URL=https://planka.example.com \
-e DATABASE_URL=postgresql://user:password@planka-db/planka \
-e DATABASE_URL=postgresql://user:password@planka-db:5432/planka \
-e SECRET_KEY=notasecretkey \
-e TRUST_PROXY=0 \
-p 1337:1337 \
@ -130,7 +129,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e BASE_URL=https://planka.example.com` | The URL you will use to access planka including protocol, and port if not 80/443. |
| `-e DATABASE_URL=postgresql://user:password@planka-db/planka` | Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding). |
| `-e DATABASE_URL=postgresql://user:password@planka-db:5432/planka` | Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding). |
| `-e SECRET_KEY=notasecretkey` | Session encryption key, recommended 32-64 character alphanumeric. |
| `-e TRUST_PROXY=0` | Set to `1` to trust upstream proxies if reverse proxying. |
| `-v /config` | Local path for planka config files. |

View File

@ -19,8 +19,8 @@ repo_vars:
- PR_DOCKERHUB_IMAGE = 'lspipepr/planka'
- DIST_IMAGE = 'alpine'
- MULTIARCH='true'
- CI='true'
- CI_WEB='true'
- CI='false'
- CI_WEB='false'
- CI_PORT='1337'
- CI_SSL='false'
- CI_DELAY='60'

View File

@ -18,7 +18,7 @@ param_container_name: "{{ project_name }}"
param_usage_include_env: true
param_env_vars:
- { env_var: "BASE_URL", env_value: "https://planka.example.com", desc: "The URL you will use to access planka including protocol, and port if not 80/443." }
- { env_var: "DATABASE_URL", env_value: "postgresql://user:password@planka-db/planka", desc: "Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)." }
- { env_var: "DATABASE_URL", env_value: "postgresql://user:password@planka-db:5432/planka", desc: "Postgres database URL. Special characters must be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding)." }
- { env_var: "SECRET_KEY", env_value: "notasecretkey", desc: "Session encryption key, recommended 32-64 character alphanumeric." }
- { env_var: "TRUST_PROXY", env_value: "0", desc: "Set to `1` to trust upstream proxies if reverse proxying." }
param_usage_include_vols: true

View File

@ -3,6 +3,28 @@
cd /app || exit 1
if [[ -n ${DATABASE_URL} ]]; then
DB_HOST=$(echo "${DATABASE_URL}" | awk -F '@' '{print $NF}' | awk -F ':' '{print $1}' | awk -F '/' '{print $1}')
DB_PORT=$(echo "${DATABASE_URL}" | awk -F '@' '{print $NF}' | awk -F ':' '{print $2}' | awk -F '/' '{print $1}')
if [[ ! ${DB_PORT} =~ [0-9]+ ]]; then DB_PORT="5432"; fi
echo "Waiting for DB ${DB_HOST} to become available on port ${DB_PORT}..."
END=$((SECONDS + 30))
while [[ ${SECONDS} -lt ${END} ]] && [[ -n "${DB_HOST+x}" ]]; do
if pg_isready -h "${DB_HOST}" -p "${DB_PORT}" -q; then
if [[ ! -f /dbwait.lock ]]; then
sleep 5
fi
touch /dbwait.lock
break
else
sleep 1
fi
done
else
echo "No database configured, sleeping..."
sleep infinity
fi
s6-setuidgid abc node db/init.js
symlinks=(
@ -26,3 +48,4 @@ shopt -u globstar dotglob
# permissions
lsiown -R abc:abc \
/config

View File

@ -5,4 +5,4 @@ export NODE_ENV=production
HOME=/config exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 1337" \
cd /app s6-setuidgid abc node app.js --prod "$@"
cd /app s6-setuidgid abc node app.js --prod