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

fix (Dockerfile): add postgresql-client for container #11

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

l2D
Copy link
Contributor

@l2D l2D commented Mar 18, 2025

This PR will add psql CLI to support check connection to PostgreSQL

domain-locker/check.js

Lines 167 to 170 in c41ee31

execSync(
`PGPASSWORD="${DL_PG_PASSWORD}" psql -h ${DL_PG_HOST} -p ${DL_PG_PORT} -U ${DL_PG_USER} -d ${DL_PG_NAME} -c "SELECT 1;"`,
{ stdio: 'ignore' }
);

Before:

2025-03-18 15:04:17 
2025-03-18 15:04:17 ██████╗  ██████╗ ███╗   ███╗ █████╗ ██╗███╗   ██╗
2025-03-18 15:04:17 ██╔══██╗██╔═══██╗████╗ ████║██╔══██╗██║████╗  ██║
2025-03-18 15:04:17 ██║  ██║██║   ██║██╔████╔██║███████║██║██╔██╗ ██║
2025-03-18 15:04:17 ██║  ██║██║   ██║██║╚██╔╝██║██╔══██║██║██║╚██╗██║
2025-03-18 15:04:17 ██████╔╝╚██████╔╝██║ ╚═╝ ██║██║  ██║██║██║ ╚████║
2025-03-18 15:04:17 ╚═════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝
2025-03-18 15:04:17                                                  
2025-03-18 15:04:17 ██╗      ██████╗  ██████╗██╗  ██╗███████╗██████╗ 
2025-03-18 15:04:17 ██║     ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
2025-03-18 15:04:17 ██║     ██║   ██║██║     █████╔╝ █████╗  ██████╔╝
2025-03-18 15:04:17 ██║     ██║   ██║██║     ██╔═██╗ ██╔══╝  ██╔══██╗
2025-03-18 15:04:17 ███████╗╚██████╔╝╚██████╗██║  ██╗███████╗██║  ██║
2025-03-18 15:04:17 ╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
2025-03-18 15:04:17     
2025-03-18 15:04:17 Licensed under MIT. Coded with ☕ and ❤️ by Lissy93
2025-03-18 15:04:17 Source at https://github.com/lissy93/domain-locker
2025-03-18 15:04:17 
2025-03-18 15:04:17 
2025-03-18 15:04:17 ⚙️ Checking config...
2025-03-18 15:04:17 🌍 Environment: Self-Hosted
2025-03-18 15:04:17 📦 Version: 0.0.3
2025-03-18 15:04:17 💾 Database Type: Postgres
2025-03-18 15:04:17 
2025-03-18 15:04:17 🔌 Testing database connection...
2025-03-18 15:04:17 Listening on http://[::]:5173
2025-03-18 15:04:17 ❌ Failed to connect to PostgreSQL: Command failed: PGPASSWORD="changeme2420" psql -h postgres -p 5432 -U postgres -d domain_locker -c "SELECT 1;"

After:

2025-03-18 15:05:00 
2025-03-18 15:05:00 ██████╗  ██████╗ ███╗   ███╗ █████╗ ██╗███╗   ██╗
2025-03-18 15:05:00 ██╔══██╗██╔═══██╗████╗ ████║██╔══██╗██║████╗  ██║
2025-03-18 15:05:00 ██║  ██║██║   ██║██╔████╔██║███████║██║██╔██╗ ██║
2025-03-18 15:05:00 ██║  ██║██║   ██║██║╚██╔╝██║██╔══██║██║██║╚██╗██║
2025-03-18 15:05:00 ██████╔╝╚██████╔╝██║ ╚═╝ ██║██║  ██║██║██║ ╚████║
2025-03-18 15:05:00 ╚═════╝  ╚═════╝ ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝
2025-03-18 15:05:00                                                  
2025-03-18 15:05:00 ██╗      ██████╗  ██████╗██╗  ██╗███████╗██████╗ 
2025-03-18 15:05:00 ██║     ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
2025-03-18 15:05:00 ██║     ██║   ██║██║     █████╔╝ █████╗  ██████╔╝
2025-03-18 15:05:00 ██║     ██║   ██║██║     ██╔═██╗ ██╔══╝  ██╔══██╗
2025-03-18 15:05:00 ███████╗╚██████╔╝╚██████╗██║  ██╗███████╗██║  ██║
2025-03-18 15:05:00 ╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
2025-03-18 15:05:00     
2025-03-18 15:05:00 Licensed under MIT. Coded with ☕ and ❤️ by Lissy93
2025-03-18 15:05:00 Source at https://github.com/lissy93/domain-locker
2025-03-18 15:05:00 
2025-03-18 15:05:00 
2025-03-18 15:05:00 ⚙️ Checking config...
2025-03-18 15:05:00 🌍 Environment: Self-Hosted
2025-03-18 15:05:00 📦 Version: 0.0.4
2025-03-18 15:05:00 💾 Database Type: Postgres
2025-03-18 15:05:00 
2025-03-18 15:05:00 🔌 Testing database connection...
2025-03-18 15:05:00 ✅ Successfully connected to PostgreSQL.
2025-03-18 15:05:00 
2025-03-18 15:05:00 🚀 Getting ready to start...
2025-03-18 15:05:00 🤘 Server will soon start at http://localhost:5173
2025-03-18 15:05:00 
2025-03-18 15:05:00 Listening on http://[::]:5173

This commit will add `psql` CLI to support check connection to PostgreSQL
@l2D l2D requested a review from Lissy93 as a code owner March 18, 2025 08:07
Copy link

vercel bot commented Mar 18, 2025

@l2D is attempting to deploy a commit to the AS93 Team on Vercel.

A member of the Team first needs to authorize it.

@Lissy93 Lissy93 merged commit b6a471b into Lissy93:main Mar 18, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants