Skip to content

Commit

Permalink
fix: docker-compose-build with .env (#2489)
Browse files Browse the repository at this point in the history
* fix: docker-compose-build with .env

* fix: package.json json format
  • Loading branch information
pratapalakshmi authored Sep 22, 2024
1 parent 3502cba commit 5dae083
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
35 changes: 23 additions & 12 deletions deploy/.env
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
BACKOFFICE_PORT=5137
HEADLESS_SVC_PORT=5173
WORKFLOW_SVC_PORT=3000
BCRYPT_SALT=10
API_KEY="secret"
NODE_ENV="development"
COMPOSE_PROJECT_NAME=ballerine-x
DB_PORT=5432
DB_USER=admin
DB_PASSWORD=admin
SESSION_SECRET=secret
DB_PORT=5432
SESSION_SECRET=iGdnj4A0YOhj8dHJK7IWSvQKEZsG7P70FFehuddhFPjtg/bSkzFejYILk4Xue6Ilx9y3IAwzR8pV1gg7
SESSION_EXPIRATION_IN_MINUTES=60
BACKOFFICE_CORS_ORIGIN=
HEADLESS_EXAMPLE_CORS_ORIGIN=
WORKFLOW_DASHBOARD_CORS_ORIGIN=
API_KEY=secret
NODE_ENV=development
ENVIRONMENT_NAME=local
SENTRY_DSN=
EMAIL_API_TOKEN=
EMAIL_API_URL=
AWS_S3_BUCKET_NAME=
AWS_S3_BUCKET_KEY=
AWS_S3_BUCKET_SECRET=
AWS_REGION=
ADMIN_API_KEY=admin_secret
MAIL_ADAPTER=log
SALESFORCE_API_VERSION=58.0
SALESFORCE_CONSUMER_KEY=
SALESFORCE_CONSUMER_SECRET=
#HASHING_KEY_SECRET="$2b$10$FovZTB91/QQ4Yu28nvL8e."
HASHING_KEY_SECRET_BASE64=JDJiJDEwJDNFeWtwWEs4QkdiczlRaWFwLkM4Vk8=
NOTION_API_KEY=secret
WORKFLOW_SVC_PORT=3000
WORKFLOW_DASHBOARD_PORT=5200
WEBSOCKET_SVC_PORT=3500
KYB_APP_PORT=5201
DOMAIN_NAME=""
HASHING_KEY_SECRET="secret"
BACKOFFICE_PORT=5137
HEADLESS_SVC_PORT=5173
3 changes: 2 additions & 1 deletion deploy/docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ services:
ballerine-workflow-service:
container_name: workflow-service
platform: linux/amd64
image: ghcr.io/ballerine-io/workflows-service:latest
build:
context: ../services/workflows-service/
command:
- /bin/sh
- -c
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"update-packages": "pnpm run changeset && pnpm run version-packages && pnpm install",
"release": "pnpm build && changeset publish",
"upload-sourcemaps": "nx run-many --target=upload-sourcemaps --all",
"docker-compose:up": "docker-compose -f deploy/docker-compose.yml up -d ",
"cli": "node ./scripts/cli.js"
"cli": "node ./scripts/cli.js",
"docker-compose:up": "docker-compose -f deploy/docker-compose-build.yml up -d "
},
"devDependencies": {
"@branchlint/cli": "^1.0.5",
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PARENT_DIR=$(dirname "$SCRIPT_DIR")
WF_FOLDER="$PARENT_DIR/services/workflows-service"
env_file="$WF_FOLDER/.env"
env_example_file="$WF_FOLDER/.env.example"
deploy_env_file="$PARENT_DIR/deploy/.env"

# Check if the .env file exists
if [[ ! -f "$env_file" ]]; then
Expand Down Expand Up @@ -48,7 +49,7 @@ set_bcrypt_salt_windows() {
update_env_file() {
adjusted_value="\"$sanitized_value\""

for file in "$env_file" "$env_example_file"; do
for file in "$env_file" "$env_example_file" "$deploy_env_file"; do
grep -v '^HASHING_KEY_SECRET_BASE64=' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
echo -e "HASHING_KEY_SECRET_BASE64=$sanitized_value" >> "$file"
done
Expand Down

0 comments on commit 5dae083

Please sign in to comment.