Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfile to containerize peepdb #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.12-slim-bookworm

ARG version=0.1.4

RUN apt update \
&& apt install -y libmariadb3 libmariadb-dev gcc \
&& pip install peepdb==$version \
&& apt remove --purge -y gcc \
&& apt autoremove --purge -y \
&& apt-get clean

ENTRYPOINT ["peepdb"]
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ You can install peepDB directly from PyPI:
pip install peepdb
```

### Docker

peepDB is also available as a `docker` image

```
docker pull [docker repo]/peepdb:0.1.4
Copy link
Author

@bobo333 bobo333 Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aherontas I'm not sure what docker repo you plan to use, I can update this accordingly if you let me know what it should be

```

To persist saved connections between container restarts, mount a volume to `/root/.peepdb/` in the container

```
$ docker volume create peepdb-data
$ docker run -it -v peepdb-data:/root/.peepdb/ peepdb:0.1.4 save --db-type postgres \
--host localhost --user postgres --password password --database my-db my-postgres-db
DEBUG:peepdb.config:Saving connection: my-postgres-db, postgres, localhost, postgres, ********, my-db
Specify the way you want to store your encryption key (os-keyring, password): password
Please entry the password to encrpyt/decrpty DB passwords: password
DEBUG:peepdb.config:Connection saved successfully
Connection 'my-postgres-db' saved successfully.
$ docker run -it -v peepdb-data:/root/.peepdb/ peepdb:0.1.4 list
Saved connections:
- my-postgres-db (postgres)
```

## 🛠️ Usage

peepDB uses a command-based structure for easier and more intuitive use. Here are the main commands with examples:
Expand Down