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

Secure Docker Compose Configuration by Using .env File #80

Open
wants to merge 1 commit 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
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POSTGRES_USER: timescaledb
POSTGRES_PASSWORD: postgrespassword
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
*/.build_*

data

# Ignore .env file
.env
16 changes: 16 additions & 0 deletions README.md
AtulRajput01 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
14 changes: 12 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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