Skip to content

DefangLabs/jupyter-postgres-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jupyter & Postgres

1-click-deploy

This sample shows you how to spin up a postgres database and a Jupyter notebook server. This is useful if you want to use Jupyter notebooks to read data from or persist data to a database.

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticate with your cloud provider account
  3. (Optional for local development) Docker CLI

Development

To run the application locally, you can use the following command:

docker compose -f compose.dev.yaml up --build

Configuration

For this sample, you will need to provide the following configuration:

Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.

POSTGRES_PASSWORD

The password to use for the postgres database.

defang config set POSTGRES_PASSWORD

JUPYTER_TOKEN

The token to access your Jupyter notebook server.

defang config set JUPYTER_TOKEN

Deployment

Note

Download Defang CLI

Defang Playground

Deploy your application to the Defang Playground by opening up your terminal and typing:

defang compose up

BYOC (AWS)

If you want to deploy to your own cloud account, you can use Defang BYOC:

  1. Authenticate your AWS account, and check that you have properly set your environment variables like AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.
  2. Run in a terminal that has access to your AWS environment variables:
    defang --provider=aws compose up

Title: Jupyter & Postgres

Short Description: This sample shows you how to spin up a postgres database and a Jupyter notebook server.

Tags: Jupyter, Postgres, Database

Languages: Python, SQL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published