forked from nestjs/schematics
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from SamagraX-Stencil/fix/refactor
Fix/refactor
- Loading branch information
Showing
13 changed files
with
329 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,70 @@ | ||
// export const content = `NODE_ENV=development | ||
// APP_PORT=3000 | ||
// APP_NAME="NestJS API" | ||
// API_PREFIX=api | ||
// APP_FALLBACK_LANGUAGE=en | ||
// APP_HEADER_LANGUAGE=x-custom-lang | ||
// FRONTEND_DOMAIN=http://localhost:3000 | ||
// BACKEND_DOMAIN=http://localhost:3000 | ||
|
||
// DATABASE_TYPE=postgres | ||
// DATABASE_HOST=postgres | ||
// DATABASE_PORT=5432 | ||
// DATABASE_USERNAME=root | ||
// DATABASE_PASSWORD=secret | ||
// DATABASE_NAME=api | ||
// DATABASE_SYNCHRONIZE=false | ||
// DATABASE_MAX_CONNECTIONS=100 | ||
// DATABASE_SSL_ENABLED=false | ||
// DATABASE_REJECT_UNAUTHORIZED=false | ||
// DATABASE_CA= | ||
// DATABASE_KEY= | ||
// DATABASE_CERT= | ||
|
||
// SHADOW_DATABASE_PORT=5431 | ||
// SHADOW_DATABASE_USERNAME=root | ||
// SHADOW_DATABASE_PASSWORD=secret | ||
// SHADOW_DATABASE_NAME=shadow | ||
|
||
// # Support "local", "s3" | ||
// FILE_DRIVER=local | ||
// ACCESS_KEY_ID= | ||
// SECRET_ACCESS_KEY= | ||
// AWS_S3_REGION= | ||
// AWS_DEFAULT_S3_BUCKET= | ||
|
||
// MAIL_HOST=maildev | ||
// MAIL_PORT=1025 | ||
// MAIL_USER= | ||
// MAIL_PASSWORD= | ||
// MAIL_IGNORE_TLS=true | ||
// MAIL_SECURE=false | ||
// MAIL_REQUIRE_TLS=false | ||
// [email protected] | ||
// MAIL_DEFAULT_NAME=Api | ||
// MAIL_CLIENT_PORT=1080 | ||
|
||
// AUTH_JWT_SECRET=secret | ||
// AUTH_JWT_TOKEN_EXPIRES_IN=15m | ||
// AUTH_REFRESH_SECRET=secret_for_refresh | ||
// AUTH_REFRESH_TOKEN_EXPIRES_IN=3650d | ||
|
||
// FACEBOOK_APP_ID= | ||
// FACEBOOK_APP_SECRET= | ||
|
||
// GOOGLE_CLIENT_ID= | ||
// GOOGLE_CLIENT_SECRET= | ||
|
||
// APPLE_APP_AUDIENCE=[] | ||
|
||
// TWITTER_CONSUMER_KEY= | ||
// TWITTER_CONSUMER_SECRET= | ||
|
||
// WORKER_HOST=redis://redis:6379/1 | ||
|
||
// DATABASE_URL="postgresql://root:secret@postgres:5432/api" | ||
// SHADOW_DATABASE_URL="postgresql://root:secret@shadow-postgres:5432/shadow"`; | ||
|
||
export const content = `NODE_ENV=development | ||
APP_PORT=3000 | ||
APP_NAME="NestJS API" | ||
|
@@ -7,9 +74,11 @@ APP_HEADER_LANGUAGE=x-custom-lang | |
FRONTEND_DOMAIN=http://localhost:3000 | ||
BACKEND_DOMAIN=http://localhost:3000 | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres | ||
DATABASE_TYPE=postgres | ||
DATABASE_HOST=postgres | ||
DATABASE_PORT=5432 | ||
DATABASE_PORT=7000 | ||
DATABASE_USERNAME=root | ||
DATABASE_PASSWORD=secret | ||
DATABASE_NAME=api | ||
|
@@ -21,11 +90,11 @@ DATABASE_CA= | |
DATABASE_KEY= | ||
DATABASE_CERT= | ||
SHADOW_DATABASE_PORT=5431 | ||
SHADOW_DATABASE_PORT=7001 | ||
SHADOW_DATABASE_USERNAME=root | ||
SHADOW_DATABASE_PASSWORD=secret | ||
SHADOW_DATABASE_NAME=shadow | ||
SHADOW_DATABASE_HOST=localhost | ||
# Support "local", "s3" | ||
FILE_DRIVER=local | ||
|
@@ -63,5 +132,20 @@ TWITTER_CONSUMER_SECRET= | |
WORKER_HOST=redis://redis:6379/1 | ||
DATABASE_URL="postgresql://root:secret@postgres:5432/api" | ||
SHADOW_DATABASE_URL="postgresql://root:secret@shadow-postgres:5432/shadow"`; | ||
DATABASE_URL="postgresql://root:secret@localhost:5432/api" | ||
SHADOW_DATABASE_URL="postgresql://root:secret@localhost:5432/shadow" | ||
FUSIONAUTH_APPLICATION_ID="f0ddb3f6-091b-45e4-8c0f-889f89d4f5da" | ||
FUSIONAUTH_SAMARTH_HP_APPLICATION_ID=f18c3f6f-45b8-4928-b978-a9906fd03f22 | ||
FUSIONAUTH_HP_ADMIN_CONSOLE_APPLICATION_ID= | ||
FUSIONAUTH_BASE_URL="http://localhost:9011" | ||
FUSIONAUTH_API_KEY="bla" | ||
ENCRYPTION_KEY="bla" | ||
FUSIONAUTH_ADMIN_SEARCH_APPLICATION_IDS=["1","2"] | ||
FUSIONAUTH_APP_MEMORY= | ||
FUSIONAUTH_APP_RUNTIME_MODE=development | ||
# Redis | ||
REDIS_HOST=localhost | ||
CACHE_PORT=8000`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
if [ -f ".env" ]; then | ||
mv .env .env.bak | ||
fi | ||
|
||
## move env-example to .env | ||
cp env-example .env | ||
docker compose up -d | ||
|
||
LOGGING_DIR="./services/logging" | ||
|
||
if [ -d "$LOGGING_DIR" ]; then | ||
|
||
cd "$LOGGING_DIR" | ||
|
||
docker compose up -d | ||
|
||
cd ../.. | ||
|
||
fi | ||
|
||
MONITOR_DIR="./services/monitor" | ||
|
||
if [ -d "$MONITOR_DIR" ]; then | ||
cd "$MONITOR_DIR" | ||
|
||
docker compose up -d | ||
|
||
cd ../.. | ||
|
||
fi | ||
|
||
TEMPORAL_DIR="./services/temporal" | ||
|
||
if [ -d "$TEMPORAL_DIR" ]; then | ||
|
||
cd "$TEMPORAL_DIR" | ||
|
||
docker compose up -d | ||
|
||
cd ../.. | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const content = `DATABASE_PORT=7003 | ||
DATABASE_USERNAME=postgres | ||
DATABASE_PASSWORD=postgres | ||
DATABASE_NAME=postgres | ||
ELASTIC_VERSION=8.11.3 | ||
CACHE_PORT=8001 | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
services: | ||
postgres: | ||
image: postgres:15.3-alpine | ||
ports: | ||
- ${DATABASE_PORT}:5432 | ||
volumes: | ||
- ./.data/db:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: ${DATABASE_USERNAME} | ||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | ||
POSTGRES_DB: ${DATABASE_NAME} | ||
healthcheck: | ||
test: ['CMD-SHELL', 'pg_isready -U postgres'] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
setup: | ||
profiles: | ||
- setup | ||
build: | ||
context: ./setup | ||
args: | ||
ELASTIC_VERSION: ${ELASTIC_VERSION} | ||
init: true | ||
volumes: | ||
- ./setup/entrypoint.sh:/entrypoint.sh:ro,Z | ||
- ./setup/lib.sh:/lib.sh:ro,Z | ||
- ./setup/roles:/roles:ro,Z | ||
environment: | ||
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-} | ||
LOGSTASH_INTERNAL_PASSWORD: ${LOGSTASH_INTERNAL_PASSWORD:-} | ||
KIBANA_SYSTEM_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} | ||
METRICBEAT_INTERNAL_PASSWORD: ${METRICBEAT_INTERNAL_PASSWORD:-} | ||
FILEBEAT_INTERNAL_PASSWORD: ${FILEBEAT_INTERNAL_PASSWORD:-} | ||
HEARTBEAT_INTERNAL_PASSWORD: ${HEARTBEAT_INTERNAL_PASSWORD:-} | ||
MONITORING_INTERNAL_PASSWORD: ${MONITORING_INTERNAL_PASSWORD:-} | ||
BEATS_SYSTEM_PASSWORD: ${BEATS_SYSTEM_PASSWORD:-} | ||
networks: | ||
- elk | ||
depends_on: | ||
- elasticsearch | ||
|
||
elasticsearch: | ||
build: | ||
context: ./elasticsearch | ||
args: | ||
ELASTIC_VERSION: ${ELASTIC_VERSION} | ||
volumes: | ||
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,Z | ||
- elasticsearch:/usr/share/elasticsearch/data:Z | ||
ports: | ||
- 9200:9200 | ||
- 9300:9300 | ||
environment: | ||
node.name: elasticsearch | ||
ES_JAVA_OPTS: -Xms512m -Xmx512m | ||
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-} | ||
discovery.type: single-node | ||
networks: | ||
- elk | ||
restart: unless-stopped | ||
|
||
logstash: | ||
build: | ||
context: ./logstash | ||
args: | ||
ELASTIC_VERSION: ${ELASTIC_VERSION} | ||
volumes: | ||
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro,Z | ||
- ./logstash/pipeline/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro,Z | ||
ports: | ||
- 5044:5044 | ||
- 50000:50000/tcp | ||
- 50000:50000/udp | ||
- 9600:9600 | ||
environment: | ||
LS_JAVA_OPTS: -Xms256m -Xmx256m | ||
LOGSTASH_INTERNAL_PASSWORD: ${LOGSTASH_INTERNAL_PASSWORD:-} | ||
networks: | ||
- elk | ||
depends_on: | ||
- elasticsearch | ||
restart: unless-stopped | ||
|
||
kibana: | ||
build: | ||
context: ./kibana | ||
args: | ||
ELASTIC_VERSION: ${ELASTIC_VERSION} | ||
volumes: | ||
- ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro,Z | ||
ports: | ||
- 5601:5601 | ||
environment: | ||
KIBANA_SYSTEM_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} | ||
networks: | ||
- elk | ||
depends_on: | ||
- elasticsearch | ||
restart: unless-stopped | ||
|
||
logstash-axiom: | ||
image: opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.2 | ||
ports: | ||
- '12201:12201/udp' | ||
volumes: | ||
- ./logstash/pipeline/axiom.conf:/usr/share/logstash/pipeline/logstash.conf | ||
command: logstash -f /usr/share/logstash/pipeline/ | ||
|
||
cache: | ||
image: redis:6.2-alpine | ||
restart: always | ||
ports: | ||
- '${CACHE_PORT}:6379' | ||
command: redis-server --save 20 1 | ||
volumes: | ||
- cache:/data | ||
|
||
networks: | ||
elk: | ||
driver: bridge | ||
default: | ||
|
||
volumes: | ||
elasticsearch: | ||
cache: | ||
driver: local |
Oops, something went wrong.