From 0b558a486c87f08fde0af356c374385fb0f16b01 Mon Sep 17 00:00:00 2001 From: Matthias G <76126743+sirux88@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:00:14 +0200 Subject: [PATCH] Updated doc files due to new docker image (#1508) * Updated several doc files * minor changes * reworked tags section on README.md --- README.md | 20 ++--- containers/docker/README.md | 88 +++++++++---------- containers/docker/RELEASE.md | 34 +++---- containers/docker/pwpush-docker-env-file | 2 +- .../pwpush-and-nginx/docker-compose.yml | 2 +- containers/helm/values.yaml | 4 +- containers/kubernetes/ephemeral_deploy.yaml | 2 +- containers/kubernetes/persistent_deploy.yaml | 2 +- 8 files changed, 79 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 5f2e32d86e8..1bc30b70997 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Password Pusher is also on [on Twitter](https://twitter.com/pwpush), [Gettr](htt _or_ -→ Run your own instance with one command: `docker run -d -p "5100:5100" pglombardo/pwpush-ephemeral:release` then go to http://localhost:5100 +→ Run your own instance with one command: `docker run -d -p "5100:5100" pglombardo/pwpush:release` then go to http://localhost:5100 _or_ @@ -82,35 +82,35 @@ Docker images of Password Pusher are available on [Docker hub](https://hub.docke **➜ ephemeral** _Temporary database that is wiped on container restart._ - docker run -d -p "5100:5100" pglombardo/pwpush-ephemeral:release + docker run -d -p "5100:5100" pglombardo/pwpush:release -[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#pwpush-ephemeral) +[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#ephemeral) **➜ using an External Postgres Database** _Postgres database backed instance._ - docker run -d -p "5100:5100" pglombardo/pwpush-postgres:release + docker run -d -p "5100:5100" pglombardo/pwpush:release -e DATABASE_URL=postgres://passwordpusher_user:passwordpusher_passwd@postgres:5432/passwordpusher_db -[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#pwpush-postgres) +[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#postgres) **➜ using an External MariaDB (MySQL) Database** _Mariadb database backed instance._ - docker run -d -p "5100:5100" pglombardo/pwpush-mysql:release + docker run -d -p "5100:5100" pglombardo/pwpush:release -e DATABASE_URL=mysql2://passwordpusher_user:passwordpusher_passwd@mysql:3306/passwordpusher_db -[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#pwpush-mysql) +[Learn more](https://github.com/pglombardo/PasswordPusher/tree/master/containers/docker#mysql) -_Note: The `latest` Docker container tag builds nightly off of the latest code changes and can occasionally be unstable. Always use the ['release' or version'd tags](https://hub.docker.com/repository/docker/pglombardo/pwpush-ephemeral/tags?page=1&ordering=last_updated) if you prefer more stability in releases._ +_Note: The `latest` Docker container tag builds nightly off of the latest code changes and can occasionally be unstable. Always use the ['release' or version'd tags](https://hub.docker.com/r/pglombardo/pwpush/tags?page=1&ordering=last_updated) if you prefer more stability in releases._ ## With Docker Compose **➜ One-liner Password Pusher with a Postgres Database** - curl -s -o docker-compose.yml https://raw.githubusercontent.com/pglombardo/PasswordPusher/master/containers/docker/pwpush-postgres/docker-compose.yml && docker compose up -d + curl -s -o docker-compose.yml https://raw.githubusercontent.com/pglombardo/PasswordPusher/master/containers/docker/pwpush/docker-compose-postgres.yml && docker compose up -d **➜ One-liner Password Pusher with a MariaDB (MySQL) Database** - curl -s -o docker-compose.yml https://raw.githubusercontent.com/pglombardo/PasswordPusher/master/containers/docker/pwpush-mysql/docker-compose.yml && docker compose up -d + curl -s -o docker-compose.yml https://raw.githubusercontent.com/pglombardo/PasswordPusher/master/containers/docker/pwpush/docker-compose-mariadb.yml && docker compose up -d ## On Kubernetes diff --git a/containers/docker/README.md b/containers/docker/README.md index 26e9c21d61a..648521c5c7f 100644 --- a/containers/docker/README.md +++ b/containers/docker/README.md @@ -1,58 +1,37 @@ -# Password Pusher & Docker Containers +# Password Pusher & Docker Container -## Container Types +# Docker Container +Available on Docker Hub: [pwpush](https://hub.docker.com/r/pglombardo/pwpush) -| Container Name | Description| -|-|-| -| **pwpush-ephemeral** | SQLite3 backed container that runs alone. All data is lost after a container restart.| -| **pwpush-postgres** | Postgres backed container that can be pointed to a pre-existing database instance using an environment variable (`DATABASE_URL`).| -| **pwpush-mysql** | MySQL or Mariadb backed container that can be pointed to a pre-existing database instance using an environment variable (`DATABASE_URL`).| - -## Tags +## Supported database backends -| Tag Name | Description | +| Backend | Description| |-|-| -| `latest` | Builds off of the latest code. May occasionally be unstable. | -| `release` | Points to the latest _stable_ release. | -| `X.X.X` | Semantic version tags. | +| **ephemeral** | SQLite3 backed container that runs alone. All data is lost after a container restart. This is set by default| +| **postgres** | Postgres backed container that can be pointed to a pre-existing database instance using an environment variable (`DATABASE_URL`).| +| **mysql** | MySQL or Mariadb backed container that can be pointed to a pre-existing database instance using an environment variable (`DATABASE_URL`).| -When in doubt, use `release`. +## ephemeral -`amd64` and `arm64` architectures are both built. Note [this bug](https://github.com/pglombardo/PasswordPusher/issues/268) in regards to tag availability for the `arm64` architecture. - -# Docker Compose - -For a quick boot of a database backed application, see the available Docker Compose files: - -* [pwpush-postgres](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush-postgres/docker-compose.yml) -* [pwpush-mysql](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush-mysql/docker-compose.yml) - -# Docker Containers - -## pwpush-ephemeral - -This is a single container that runs independently using sqlite3 with no persistent storage (if you recreate the container the data is lost); best if don't care too much about the data and and looking for simplicity in deployment. +This configuration runs independently using sqlite3 with no persistent storage (if you recreate the container the data is lost); best if don't care too much about the data and looking for simplicity in deployment. To run an ephemeral version of Password Pusher that saves no data after a container restart: -`docker run -p "8000:5100" pglombardo/pwpush-ephemeral:latest` +`docker run -p "8000:5100" pglombardo/pwpush:latest` _This example is set to listen on port 8000 for requests e.g. http://0.0.0.0:8000._ -Available on Docker hub: [pwpush-ephemeral](https://hub.docker.com/repository/docker/pglombardo/pwpush-ephemeral) - -See also this discussion if you want to persist data across container restarts: [pwpush-ephemeral: How to Add Persistence?](https://github.com/pglombardo/PasswordPusher/discussions/448) +See also this discussion if you want to persist data across container restarts: [pwpush-ephemeral: How to Add Persistence?](https://github.com/pglombardo/PasswordPusher/discussions/448) +(Since this link refers to an outdated ephemeral image keep in mind to use current image `pglombardo/pwpush`) -## pwpush-postgres +## postgres -This container uses a default database URL of: +To setup the container to use the PostgreSQL database backend DATABASE_URL environment variable needs to be configured. The syntax should look like: DATABASE_URL=postgresql://passwordpusher_user:passwordpusher_passwd@postgres:5432/passwordpusher_db -You can either configure your PostgreSQL server to use these credentials or override the environment var in the command line: +You can either configure your PostgreSQL server to use these credentials or override the environment variable in the command line: - docker run -d -p "5100:5100" -e "DATABASE_URL=postgresql://user:passwd@postgres:5432/my_db" pglombardo/pwpush-postgres:latest - -Available on Docker hub: [pwpush-postgres](https://hub.docker.com/repository/docker/pglombardo/pwpush-postgres) + docker run -d -p "5100:5100" -e "DATABASE_URL=postgresql://user:passwd@postgres:5432/my_db" pglombardo/pwpush:latest ### Better Security with Password Files @@ -61,16 +40,37 @@ Providing a PostgreSQL password on the command line such as in the preceeding is See [this section on Docker Secrets](https://github.com/docker-library/docs/blob/master/postgres/README.md#docker-secrets) on how to avoid passing credentials on the command line. Further, also [consider this example](https://github.com/pglombardo/PasswordPusher/issues/412) provided by [Viajaz](https://github.com/Viajaz). -## pwpush-mysql +## mysql -This container uses a default database URL of: +To setup the container to use the MariaDB/MySQL database backend DATABASE_URL environment variable needs to be configured. The syntax should look like: DATABASE_URL=mysql2://passwordpusher_user:passwordpusher_passwd@mysql:3306/passwordpusher_db -You can either configure your MySQL server to use these credentials or override the environment var in the command line: +You can either configure your MariaDB/MySQL server to use these credentials or override the environment var in the command line: + + docker run -d -p "5100:5100" -e "DATABASE_URL=mysql2://pwpush_user:pwpush_passwd@mysql:3306/pwpush_db" pglombardo/pwpush:latest + +_Note: Providing a MariaDB/MySQL password on the command line is far less than ideal_ - docker run -d -p "5100:5100" -e "DATABASE_URL=mysql2://pwpush_user:pwpush_passwd@mysql:3306/pwpush_db" pglombardo/pwpush-mysql:latest -_Note: Providing a MySQL password on the command line is far less than ideal_ +## Tags + +| Tag Name | Description | +|-|-| +| `latest` | Builds off of the latest code. May occasionally be unstable. | +| `release` | Points to the latest _stable_ release. | +| `X.X.X` | Semantic version tags. | + +When in doubt, use `release`. + +## Platforms +The docker container is available for `linux/amd64` and `linux/arm64` platforms. + +# Docker Compose + +For a quick boot of a database backed application, see the available Docker Compose files: +* [ephemeral](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush/docker-compose-ephemeral.yml) +* [postgres](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush/docker-compose-postgres.yml) +* [mysql](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush/docker-compose-mysql.yml) +* [mariadb](https://github.com/pglombardo/PasswordPusher/blob/master/containers/docker/pwpush/docker-compose-mariadb.yml) -Available on Docker hub: [pwpush-mysql](https://hub.docker.com/repository/docker/pglombardo/pwpush-mysql) diff --git a/containers/docker/RELEASE.md b/containers/docker/RELEASE.md index 7a23c7562bc..3ae1856606c 100644 --- a/containers/docker/RELEASE.md +++ b/containers/docker/RELEASE.md @@ -1,21 +1,25 @@ # Container Release Cheat Sheet -cd pwpush-postgres +cd pwpush +docker build --no-cache -t pglombardo/pwpush: . +docker push pglombardo/pwpush: +docker tag pglombardo/pwpush:latest +docker push pglombardo/pwpush:latest -docker build --no-cache -t pglombardo/pwpush-postgres: . +cd pwpush-postgres -docker push pglombardo/pwpush-postgres: +docker build --no-cache -t pglombardo/pwpush-postgres: . +docker push pglombardo/pwpush-postgres: +docker tag pglombardo/pwpush-postgres:latest +docker push pglombardo/pwpush-postgres:latest -docker tag pglombardo/pwpush-postgres:latest +cd pwpush-ephemeral +docker build --no-cache -t pglombardo/pwpush-ephemeral: . +docker push pglombardo/pwpush-ephemeral: +docker tag pglombardo/pwpush-ephemeral:latest +docker push pglombardo/pwpush-ephemeral:latest -docker push pglombardo/pwpush-postgres:latest - -cd pwpush-ephemeral -docker build --no-cache -t pglombardo/pwpush-ephemeral: . -docker push pglombardo/pwpush-ephemeral: -docker tag pglombardo/pwpush-ephemeral:latest -docker push pglombardo/pwpush-ephemeral:latest - -docker tag pglombardo/pwpush-ephemeral:1.10.2 pglombardo/pwpush-ephemeral:release -docker tag pglombardo/pwpush-postgres:1.10.2 pglombardo/pwpush-postgres:release -docker tag pglombardo/pwpush-mysql:1.10.2 pglombardo/pwpush-mysql:release \ No newline at end of file +docker tag pglombardo/pwpush:1.10.2 pglombardo/pwpush:release +docker tag pglombardo/pwpush-ephemeral:1.10.2 pglombardo/pwpush-ephemeral:release +docker tag pglombardo/pwpush-postgres:1.10.2 pglombardo/pwpush-postgres:release +docker tag pglombardo/pwpush-mysql:1.10.2 pglombardo/pwpush-mysql:release \ No newline at end of file diff --git a/containers/docker/pwpush-docker-env-file b/containers/docker/pwpush-docker-env-file index cd308691087..d134ce18ebc 100644 --- a/containers/docker/pwpush-docker-env-file +++ b/containers/docker/pwpush-docker-env-file @@ -2,7 +2,7 @@ # Docker container. # # This can be passed to docker as: -# docker run -d --env-file ./pwpush-docker-env-file pglombardo/pwpush-ephemeral:release +# docker run -d --env-file ./pwpush-docker-env-file pglombardo/pwpush:release # # This is not an authoratative list of possible environment variables. # See the full list of supported configuration environment variables: diff --git a/containers/examples/pwpush-and-nginx/docker-compose.yml b/containers/examples/pwpush-and-nginx/docker-compose.yml index 0acdf9fd02e..df34eb038c9 100644 --- a/containers/examples/pwpush-and-nginx/docker-compose.yml +++ b/containers/examples/pwpush-and-nginx/docker-compose.yml @@ -14,7 +14,7 @@ services: links: - pwpush:proxy pwpush: - image: docker.io/pglombardo/pwpush-ephemeral:release + image: docker.io/pglombardo/pwpush:release ports: - "5100:5100" env_file: diff --git a/containers/helm/values.yaml b/containers/helm/values.yaml index b302b56f07a..c543a4fd68c 100644 --- a/containers/helm/values.yaml +++ b/containers/helm/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 deployment: labels: - app: "pwpush-ephemeral" + app: "pwpush" # component: ingress-controller # type: nginx containerPort: 5100 @@ -17,7 +17,7 @@ deployment: path: / image: - repository: docker.io/pglombardo/pwpush-ephemeral + repository: docker.io/pglombardo/pwpush pullPolicy: Always tag: "release" diff --git a/containers/kubernetes/ephemeral_deploy.yaml b/containers/kubernetes/ephemeral_deploy.yaml index a8982fe67d9..6ef3568ea41 100644 --- a/containers/kubernetes/ephemeral_deploy.yaml +++ b/containers/kubernetes/ephemeral_deploy.yaml @@ -31,7 +31,7 @@ spec: type: nginx spec: containers: - - image: docker.io/pglombardo/pwpush-ephemeral + - image: docker.io/pglombardo/pwpush imagePullPolicy: Always name: pwpush resources: {} diff --git a/containers/kubernetes/persistent_deploy.yaml b/containers/kubernetes/persistent_deploy.yaml index 194125efa4b..36748fe4663 100644 --- a/containers/kubernetes/persistent_deploy.yaml +++ b/containers/kubernetes/persistent_deploy.yaml @@ -31,7 +31,7 @@ spec: type: nginx spec: containers: - - image: docker.io/pglombardo/pwpush-postgres + - image: docker.io/pglombardo/pwpush imagePullPolicy: Always name: pwpush env: