Skip to content

Commit

Permalink
feat: db changed to postgres (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
maanasb01 authored Sep 16, 2024
1 parent 671373f commit ba05b9e
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 110 deletions.
6 changes: 3 additions & 3 deletions browser-extension/api-server/db/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ module.exports = {
password: process.env.DB_PASSWORD,
database: "uli_dev",
host: process.env.DB_HOST,
dialect: "mysql",
dialect: "postgres",
},
test: {
username: "root",
password: null,
database: "uli_test",
host: "127.0.0.1",
dialect: "mysql",
dialect: "postgres",
},
production: {
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: "uli_prod_unicode",
host: process.env.DB_HOST,
dialect: "mysql",
dialect: "postgres",
},
};
233 changes: 137 additions & 96 deletions browser-extension/api-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion browser-extension/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"express": "4.18.2",
"multer": "1.4.5-lts.1",
"multer-s3": "3.0.1",
"mysql2": "3.6.3",
"password-generator": "2.3.2",
"pg": "^8.12.0",
"pg-hstore": "^2.3.4",
"sequelize": "6.35.1",
"sequelize-cli": "6.6.2",
"uuid": "9.0.1"
Expand Down
24 changes: 14 additions & 10 deletions browser-extension/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ version: "3"

services:
db:
image: "mysql"
command: --default-authentication-plugin=mysql_native_password
image: postgres:14.10
restart: always
environment:
MYSQL_ROOT_PASSWORD: root_pw
MYSQL_USER: tattle
MYSQL_PASSWORD: tattle_pw
MYSQL_DATABASE: uli_dev
ports:
- 3306:3306
- POSTGRES_USER=tattle
- POSTGRES_PASSWORD=tattle_pw
- POSTGRES_DB=uli_dev
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 1s
timeout: 5s
retries: 10
volumes:
- "~/data/ogbv_plugin/db:/var/lib/mysql"
- ~/data/uli_test/postgres:/var/lib/postgresql/data
ports:
- 5432:5432
db_gui:
image: adminer
restart: always
Expand All @@ -27,10 +30,11 @@ services:
dockerfile: Dockerfile
depends_on:
- db
command: tail -f /dev/null
# command: tail -f /dev/null
ports:
- 3000:3000
volumes:
- "./api-server:/app"
- /app/node_modules
env_file:
- "./api-server/development.env"

0 comments on commit ba05b9e

Please sign in to comment.