Skip to content

Commit

Permalink
Merge pull request #342 from BaseAdresseNationale/antoineludeau/add-p…
Browse files Browse the repository at this point in the history
…ostgres-port-setting

Added postgres port env variable
  • Loading branch information
antoineludeau authored Dec 12, 2023
2 parents c0e05cd + d80ab84 commit 6379350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit 6379350

Please sign in to comment.