Skip to content

Commit

Permalink
Added redis
Browse files Browse the repository at this point in the history
  • Loading branch information
MoroccanTea committed May 21, 2024
1 parent ca000c0 commit b84680c
Show file tree
Hide file tree
Showing 8 changed files with 1,310 additions and 24 deletions.
24 changes: 24 additions & 0 deletions docker/Docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ networks:
app-network:
driver: bridge

postgresql:
container_name: postgresql
image: postgres:latest
ports:
- 5432:5432
env_file:
- ../.env
volumes:
- postgresql-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- app-network

redis-cache:
container_name: redis-cache
image: redis:latest
ports:
- 6379:6379
networks:
- app-network

volumes:
mongodb-data:
driver: local
Expand Down
19 changes: 11 additions & 8 deletions models/Category.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
const mongoose = require('mongoose');
// models/Category.js
const { DataTypes } = require('sequelize');
const sequelize = require('../sequelize');

const CategorySchema = new mongoose.Schema({
const Category = sequelize.define('Category', {
name: {
type: String,
required: true,
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: String,
required: true,
type: DataTypes.STRING,
allowNull: false,
},
}, { timestamps: true });
}, {
timestamps: true,
});

const Category = mongoose.model('Category', CategorySchema);
module.exports = Category;
Loading

0 comments on commit b84680c

Please sign in to comment.