Skip to content

Commit

Permalink
Enhance Docker tooling (#18)
Browse files Browse the repository at this point in the history
Update docker configurations to improve environment handling

- Adjust `.dockerignore` to include specific `.env` files instead of
generic `.env*`.
- Modify `docker-compose.[production|development].yml` to use optional
environment variables for extra parameters.
- Update `.env.sample` with new environment variables and the latest
`PGADMIN_VERSION`.
- Refactor `docker/pgadmin/servers.json` to simplify server naming and
grouping.
  • Loading branch information
jorgecuesta authored Sep 12, 2024
1 parent 2a31c35 commit 381bc57
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ src/types
project.yaml

# dotenv files
.env*
.env.sample
.env.development
.env.production
.env.test

# not needed
docs
Expand Down
8 changes: 7 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ POSTGRES_DB=postgres
# Pgadmin4
# NOTE: if you modify POSTGRES_USER/PASSWORD/DB then auto-imported server will not match and you need to setup
# your own with the modified values on the pgadmin website after first login.
PGADMIN_VERSION=8.8
PGADMIN_VERSION=8.11
PGADMIN_DEFAULT_EMAIL=[email protected]
PGADMIN_DEFAULT_PASSWORD=admin
PGADMIN_LISTEN_PORT=5050
Expand All @@ -27,6 +27,12 @@ CHAIN_ID=poktroll
# ENDPOINT=http://proxy:26657
# Testnet
ENDPOINT=https://testnet-validated-validator-rpc.poktroll.com
# Check docs to see what else you can set here:
# Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-cli
SUBQUERY_NODE_EXTRA_PARAMS="--unfinalized-blocks=true"
# Check docs to see what else you can set here:
# Ref: https://academy.subquery.network/indexer/run_publish/references.html#subql-query
SUBQUERY_GRAPHQL_EXTRA_PARAMS=

# Subquery Graphql Engine
SUBQUERY_GRAPHQL_ENGINE_VERSION=latest
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:
- ./src:/app/src
- ignore_types:/app/src/types
command:
- --unfinalized-blocks=true
- ${SUBQUERY_NODE_EXTRA_PARAMS:-}
healthcheck:
test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"]
interval: 3s
Expand All @@ -101,9 +101,10 @@ services:
DB_PASS: ${POSTGRES_PASSWORD}
DB_DATABASE: ${POSTGRES_DB}
command:
- ${SUBQUERY_GRAPHQL_EXTRA_PARAMS:-}
- --name=${DB_SCHEMA}
- --playground
- --indexer=http://subquery-node:3000
- --playground
networks:
- pocketdex

Expand Down
5 changes: 3 additions & 2 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ services:
ENDPOINT: ${ENDPOINT}
CHAIN_ID: ${CHAIN_ID}
command:
- --unfinalized-blocks=true
- ${SUBQUERY_NODE_EXTRA_PARAMS:-}
healthcheck:
test: ["CMD", "curl", "-f", "http://subquery-node:3000/ready"]
interval: 3s
Expand All @@ -94,9 +94,10 @@ services:
DB_HOST: postgres
DB_PORT: 5432
command:
- ${SUBQUERY_GRAPHQL_EXTRA_PARAMS:-}
- --name=${DB_SCHEMA}
- --playground
- --indexer=http://subquery-node:3000
- --playground
networks:
- pocketdex

Expand Down
6 changes: 3 additions & 3 deletions docker/pgadmin/servers.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"DefaultServers": {
"Servers": {
"1": {
"Name": "[email protected]",
"Group": "Localnet",
"Name": "pocketdex",
"Group": "Servers",
"Host": "postgres",
"Port": 5432,
"MaintenanceDB": "postgres",
Expand Down

0 comments on commit 381bc57

Please sign in to comment.