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

Added postgres port env variable #342

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MONGODB_DBNAME=ban

# Postgres DB
POSTGRES_URL=localhost # Not used for deployment with Docker Compose
POSTGRES_PORT=5432 # Used only for deployment with Docker Compose
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DBNAME=ban
Expand Down
3 changes: 3 additions & 0 deletions lib/util/sequelize.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {Sequelize, DataTypes} from 'sequelize'

const POSTGRES_PORT = process.env.POSTGRES_PORT || 5432

// Create a new Sequelize instance
export const sequelize = new Sequelize(process.env.POSTGRES_DBNAME, process.env.POSTGRES_USER, process.env.POSTGRES_PASSWORD, {
host: process.env.POSTGRES_URL,
port: POSTGRES_PORT,
dialect: 'postgres',
logging: false
})
Expand Down
Loading