Skip to content

Commit

Permalink
Updated several doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
sirux88 committed Oct 7, 2023
1 parent 8ab4a07 commit 7d081f1
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 74 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand All @@ -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

Expand Down
85 changes: 42 additions & 43 deletions containers/docker/README.md
Original file line number Diff line number Diff line change
@@ -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. |

When in doubt, use `release`.
| **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`).|

`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:
## ephemeral

* [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 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 postgres 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:

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

Expand All @@ -61,16 +40,36 @@ 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 mysql/mariadb 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 MySQL / MariaDB 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 MySQL / MariaDB 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`.

docker run -d -p "5100:5100" -e "DATABASE_URL=mysql2://pwpush_user:pwpush_passwd@mysql:3306/pwpush_db" pglombardo/pwpush-mysql:latest
`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

_Note: Providing a MySQL password on the command line is far less than ideal_
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)
34 changes: 19 additions & 15 deletions containers/docker/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# Container Release Cheat Sheet

cd pwpush-postgres
cd pwpush
docker build --no-cache -t pglombardo/pwpush:<version> .
docker push pglombardo/pwpush:<version>
docker tag <tag> pglombardo/pwpush:latest
docker push pglombardo/pwpush:latest

docker build --no-cache -t pglombardo/pwpush-postgres:<version> .
cd pwpush-postgres

docker push pglombardo/pwpush-postgres:<version>
docker build --no-cache -t pglombardo/pwpush-postgres:<version> .
docker push pglombardo/pwpush-postgres:<version>
docker tag <tag> pglombardo/pwpush-postgres:latest
docker push pglombardo/pwpush-postgres:latest

docker tag <tag> pglombardo/pwpush-postgres:latest
cd pwpush-ephemeral
docker build --no-cache -t pglombardo/pwpush-ephemeral:<version> .
docker push pglombardo/pwpush-ephemeral:<version>
docker tag <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:<version> .
docker push pglombardo/pwpush-ephemeral:<version>
docker tag <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
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
2 changes: 1 addition & 1 deletion containers/docker/pwpush-docker-env-file
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion containers/examples/pwpush-and-nginx/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions containers/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ replicaCount: 1

deployment:
labels:
app: "pwpush-ephemeral"
app: "pwpush"
# component: ingress-controller
# type: nginx
containerPort: 5100
Expand All @@ -17,7 +17,7 @@ deployment:
path: /

image:
repository: docker.io/pglombardo/pwpush-ephemeral
repository: docker.io/pglombardo/pwpush
pullPolicy: Always
tag: "release"

Expand Down
2 changes: 1 addition & 1 deletion containers/kubernetes/ephemeral_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down
2 changes: 1 addition & 1 deletion containers/kubernetes/persistent_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7d081f1

Please sign in to comment.