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.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
To run the application locally, you can use the following command:
docker compose -f compose.dev.yaml up --build
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.
The password to use for the postgres database.
defang config set POSTGRES_PASSWORD
The token to access your Jupyter notebook server.
defang config set JUPYTER_TOKEN
Note
Download Defang CLI
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose up
If you want to deploy to your own cloud account, you can use Defang BYOC:
- Authenticate your AWS account, and check that you have properly set your environment variables like
AWS_PROFILE
,AWS_REGION
,AWS_ACCESS_KEY_ID
, andAWS_SECRET_ACCESS_KEY
. - 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