From 5803e38f3e0d0620eda4eaf5b8b35afe9329da8a Mon Sep 17 00:00:00 2001 From: AtulRajput01 Date: Wed, 21 Jun 2023 23:56:46 +0530 Subject: [PATCH] Create .env.sample file --- .env.sample | 2 ++ .gitignore | 3 +++ README.md | 16 ++++++++++++++++ docker-compose.yml | 14 ++++++++++++-- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .env.sample diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..ca46d7aa --- /dev/null +++ b/.env.sample @@ -0,0 +1,2 @@ +POSTGRES_USER: timescaledb +POSTGRES_PASSWORD: postgrespassword diff --git a/.gitignore b/.gitignore index 8c9f37e2..9220c9c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ */.build_* data + +# Ignore .env file +.env diff --git a/README.md b/README.md index b9df2bcb..95fede02 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,22 @@ services: POSTGRES_USER: warpSQLUser POSTGRES_PASSWORD: warpSQLPass ``` +# Environment Variables + +Ensure that you have a `.env.sample` file same directory as the `docker-compose.yml` file. +Open the `.env.sample` file in a text editor. +Provide placeholders for the required environment variables in the `.env.sample` file. Do not include any actual sensitive information in this file. Here's an example of how the `.env.sample` file should look: + +``` +POSTGRES_USER: timescaledb +POSTGRES_PASSWORD: postgrespassword +``` +Before running the project, create a new file named `.env` in the same directory as the `docker-compose.yml` file. +Open the `.env` file and provide the actual values for the environment variables, specific to your setup. For example: +`POSTGRES_USER=myuser` +`POSTGRES_PASSWORD=mypassword` + +Replace myuser and mypassword with the actual values you want to use. WarpSQL is a powerful solution that provides opinionated extensions to Postgres, conveniently packaged as a single Docker deployment. It eliminates the need to install multiple separate databases by offering a comprehensive set of features in one place (although not everything, as some features might not be included). diff --git a/docker-compose.yml b/docker-compose.yml index 2141a4f6..c14d4c9b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,8 @@ services: volumes: - ./pgdata:/var/lib/postgresql/data environment: - POSTGRES_USER: timescaledb - POSTGRES_PASSWORD: postgrespassword + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} graphql-engine: image: hasura/graphql-engine:latest @@ -33,3 +33,13 @@ services: # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey HASURA_GRAPHQL_MIGRATIONS_DISABLE_TRANSACTION: "true" HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets + + pgwatch2: + image: cybertec/pgwatch2-postgres:latest + ports: + - "3000:3000" + environment: + PW2_ADHOC_CONN_STR: "postgresql://timescaledb:postgrespassword@timescaledb:5432/postgres?sslmode=disable" + depends_on: + - "timescaledb" + restart: always