Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.

Commit 648930a

Browse files
authored
feat: Update readme, cleanup docker-compose (#4)
1 parent 94a2a29 commit 648930a

File tree

4 files changed

+80
-12
lines changed

4 files changed

+80
-12
lines changed

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jupyter-pgweb-proxy
22

3-
This package was built using the [`illumidesk/jupyter-server-proxy` cookiecutter template](https://github.com/illumidesk/cookiecutter-jupyter-server-proxy).
3+
This package was built from the [`illumidesk/cookiecutter-jupyter-server-proxy`](https://github.com/illumidesk/cookiecutter-jupyter-server-proxy) template.
44

55
## Requirements
66

@@ -10,27 +10,69 @@ This package was built using the [`illumidesk/jupyter-server-proxy` cookiecutter
1010

1111
This package executes the standard `pgweb` command. This command assumes the `pgweb` command is available in the environment's `PATH`.
1212

13-
### Install jupyter-pgweb-proxy
13+
## What?
1414

15-
Install the package with pip:
15+
Check it out, [it's pretty sweet](https://github.com/sosedoff/pgweb).
1616

17-
```
18-
pip install git+https://github.com/illumidesk/jupyter-pgweb-proxy.git
19-
```
17+
## Quick Starts
2018

21-
## Example
19+
### Launch with `binder`
2220

23-
Try with binder:
21+
This test requires you to have a database instance available as a public endpoint or installed within the notebook container itself.
2422

2523
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/illumidesk/jupyter-pgweb-proxy/main?urlpath=pgweb)
2624

27-
Test locally:
25+
### Run locally with `docker-compose`
2826

2927
```bash
3028
docker build -t jupyter/pgweb .
3129
docker build -it --rm -p 8888:8888 jupyter/pgweb
3230
```
3331

32+
1. Open your browser: http://localhost:8889
33+
1. Click the `pgweb` item from the `New` dropdown in `Jupyter Classic` or click on the green `pgweb` icon in the Notebooks section in `Jupyter Lab`.
34+
1. Connect with the `Scheme` or `Standard` option.
35+
36+
```
37+
postgres://postgres:postgres@testdb:5432/db?sslmode=disable
38+
```
39+
40+
## The Hard Way
41+
42+
### Create and Activate Environment
43+
44+
```bash
45+
virtualenv -p python3 venv
46+
source venv/bin/activate
47+
```
48+
49+
### Install jupyter-pgweb-proxy
50+
51+
```bash
52+
pip install git+https://github.com/illumidesk/jupyter-pgweb-proxy.git
53+
```
54+
55+
### Enable jupyter-pgweb-proxy Extensions
56+
57+
1. For Jupyter Classic, activate the `jupyter-server-proxy` extension:
58+
59+
```bash
60+
jupyter serverextension enable --sys-prefix jupyter_server_proxy
61+
```
62+
63+
2. For Jupyter Lab, install the `@jupyterlab/server-proxy` extension:
64+
65+
```bash
66+
jupyter labextension install @jupyterlab/server-proxy
67+
jupyter lab build
68+
```
69+
70+
3. Start Jupyter Classic or Jupyter Lab
71+
72+
4. Click on the `pgweb` icon from the Jupyter Lab Launcher or the `pgweb` item from the `New` dropdown in Jupyter Classic.
73+
74+
5. Connect to your database as instructed in the [Quickstart](#quickstart) section.
75+
3476
## Credits
3577

3678
- [`jupyter-server-proxy`](https://github.com/jupyterhub/jupyter-server-proxy)

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker-compose

docker-compose.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "3.8"
2+
3+
services:
4+
jupyter:
5+
image: jupyter/pgweb
6+
build:
7+
context: .
8+
container_name: notebook
9+
restart: always
10+
ports:
11+
- 8889:8888
12+
testdb:
13+
image: postgres:12.3-alpine
14+
container_name: postgres-labs
15+
restart: always
16+
environment:
17+
- POSTGRES_DB=postgres
18+
- POSTGRES_USER=postgres
19+
- POSTGRES_PASSWORD=postgres
20+
volumes:
21+
- db:/var/lib/postgresql/data
22+
23+
volumes:
24+
db:
25+
name: db

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
setuptools.setup(
1212
name="jupyter-pgweb-proxy",
13-
version='0.1.0',
13+
version='0.1.1',
1414
url="https://github.com/illumidesk/jupyter-pgweb-proxy",
1515
author="IllumiDesk Team",
1616
description="[email protected]",
1717
long_description=long_description,
1818
long_description_content_type='text/markdown',
1919
packages=setuptools.find_packages(),
20-
keywords=['jupyter', 'pgweb', 'jupyterhub'],
20+
keywords=['jupyter', 'pgweb', 'jupyterhub', 'jupyter-server-proxy'],
2121
classifiers=['Framework :: Jupyter'],
2222
install_requires=[
23-
'jupyter-server-proxy>=1.5.0'
23+
'jupyter-server-proxy>=1.5.0',
2424
],
2525
entry_points={
2626
'jupyter_serverproxy_servers': [

0 commit comments

Comments
 (0)