diff --git a/README.md b/README.md index cdadf8e..0c53f93 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - fork or download this repository - install dependencies with `npm i` -- create fitness_app database (application access `postgresql://localhost:5432/fitness_app`, make sure you use correct port and db name ) +- create fitness_app database with `docker compose up -d` or manually (application access `postgresql://postgres:root@localhost:5432/fitness_app`, make sure you use correct port, db name and db credentials ) - create db schema and populate db with `npm run seed` - run express server with `npm start` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fa8f6f8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +name: fitness-app + +services: + db: + container_name: fitness-app-database + image: postgres:16 + environment: + POSTGRES_DB: fitness_app + POSTGRES_USER: postgres + POSTGRES_PASSWORD: root + ports: + - '5432:5432' + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/src/db/index.ts b/src/db/index.ts index bac1357..83a9077 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -4,7 +4,7 @@ import { Sequelize } from 'sequelize' import defineExercise from './exercise' import defineProgram from './program' -const sequelize: Sequelize = new Sequelize('postgresql://localhost:5432/fitness_app', { +const sequelize: Sequelize = new Sequelize('postgresql://postgres:root@localhost:5432/fitness_app', { logging: false })