Skip to content

Commit

Permalink
chore: sample secrets file added to run the project
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashok authored and Ashok committed Mar 23, 2024
1 parent de5bf77 commit 408d1ec
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- ./:/app
- /app/node_modules
restart: 'unless-stopped'
entrypoint: [ "/app/wait-for.sh", "postgres:5432", "--", "sh", "-c", "node_modules/.bin/sequelize-cli db:migrate --env=test --config=/etc/secrets/db-config.json --migrations-path=src/migrations && npm run start:dev"]
entrypoint: [ "/app/wait-for.sh", "postgres:5432", "--", "sh", "-c", "node_modules/.bin/sequelize-cli db:migrate --env=production --config=/etc/secrets/db-config.json --migrations-path=src/migrations && npm run start:dev"]
networks:
- eth-network
depends_on:
Expand Down
19 changes: 19 additions & 0 deletions secrets_example/config/database.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"development": {
"username": "ashok",
"password": "secret",
"database": "eth",
"host": "localhost",
"dialect": "postgres",
"port": 5432
},
"production": {
"username": "ashok",
"password": "secret",
"database": "eth",
"host": "postgres",
"dialect": "postgres",
"port": 5432
}

}
3 changes: 3 additions & 0 deletions secrets_example/database.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_DB=eth
POSTGRES_USER=ashok
POSTGRES_PASSWORD=secret
29 changes: 29 additions & 0 deletions secrets_example/env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

NODE_ENV=production #DO NOT CHANGE

PORT=4000
VERSION=v1
ORIGIN=*

DB_USER=ashok
DB_PASSWORD=secret
DB_DATABASE=eth
DB_PORT=5432

DB_HOST=postgres #DO NOT CHANGE

JWT_SECRET=7LdPnw30KauR9jg63TJpw2BXixqrgo1j
JWT_EXPIRY=1d

LOCAL_NODE_PROVIDER_URL=http://127.0.0.1:8545

INFURA_API_KEY=
INFURA_PROJECT_ID=
INFURA_PROJECT_SECRET=

NETWORK_NAME=sepolia
CHAIN_ID=11155111


AUCTION_CONTRACT_ADDRESS=0x23436F18efEEcf9AB7210626940963F3d2549053 #Auction contract deployed on Sepolia testnet
# Contract url => https://sepolia.etherscan.io/address/0x23436F18efEEcf9AB7210626940963F3d2549053
12 changes: 9 additions & 3 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ import { AuctionModule } from './auction/auction.module';
validationSchema: Joi.object({
NODE_ENV: Joi.string()
.required()
.valid('development', 'production', 'staging', 'provision')
.valid('development', 'production', 'test')
.default('development'),
PORT: Joi.number().required().default(3000),
VERSION: Joi.string().required().default(''),
PORT: Joi.number().required().default(4000),
INFURA_PROJECT_ID: Joi.string().required().default(''),
INFURA_PROJECT_SECRET: Joi.string().required().default(''),
NETWORK_NAME: Joi.string().required().default('sepolia'),
CHAIN_ID: Joi.string().required().default(11155111),
AUCTION_CONTRACT_ADDRESS: Joi.string()
.required()
.default('0x23436F18efEEcf9AB7210626940963F3d2549053'),
}),
}),
DatabaseModule,
Expand Down

0 comments on commit 408d1ec

Please sign in to comment.