Environment Configuration
Step 1: Create the .env File
On the host, run:
cd /opt/hivel-onprem
cp config/.env.template config/.env
nano config/.envStep 2: Configure Phase 1 Database Credentials (For Migration)
Add the superuser credentials. These are used only during the migration step:
DB_HOST=<host-running-postgres-private-ip>
DB_PORT=5432
DB_NAME=insightly
DB_USER=postgres
DB_PASSWORD='your_superuser_password'Step 3: Configure Phase 2 Database Credentials (After Migration)
After the migration succeeds, update the .env file to use the application user credentials:
DB_HOST=<host-running-postgres-private-ip>
DB_PORT=5432
DB_NAME=insightly
DB_USER=postgres
DB_PASSWORD='<APPLICATION_USER_PASSWORD>'Customizing the Application Password:
If you want to use a different password for the application user:
Before migration: Update the password in the Flyway migration scripts/config
After migration: Update
config/.envwith the new passwordEnsure the password is consistent in both locations
Step 4: Apply Password Quoting Rules
Passwords containing special characters require single quotes. Use these rules:
Rule 1: Any password containing ()[]$&|;#<>* or spaces must be single-quoted:
Rule 2: If the password contains a literal $, escape it as $$ even inside single quotes (Docker Compose interpolates ${...} variables):
Rule 3: Single quotes (') cannot appear within the password itself. Example - this is invalid: DB_PASSWORD='pass'word'. Instead, enclose the entire password: DB_PASSWORD='password'.
Step 5: Test Database Connection
Verify the connection from the host:
When prompted, enter the superuser password.
Success: A psql prompt (insightly=#) appears with no errors
Failure: Check the host/port/credentials and confirm PostgreSQL is running and accepting connections
Last updated