docker compose run with .env file

docker compose volumes fix
import fix
add methods and indexes for models
master
Mustafa Yontar 3 years ago
parent 24b5ebc40a
commit 73a5820535
  1. 25
      docker-compose-dev.yaml
  2. 1
      main.py
  3. 15
      models/Account.py
  4. 36
      models/Group.py
  5. 17
      models/Payment.py

@ -3,9 +3,8 @@ version: "3"
services:
mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: xcoder
MONGO_INITDB_ROOT_PASSWORD: 4dun4710
env_file:
.env
volumes:
- mongo_data:/data/db/
@ -13,22 +12,22 @@ services:
image: mongo-express
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: xcoder
ME_CONFIG_MONGODB_ADMINPASSWORD: 4dun4710
ME_CONFIG_OPTIONS_EDITORTHEME: ambiance
ME_CONFIG_BASICAUTH_USERNAME: xcoder
ME_CONFIG_BASICAUTH_PASSWORD: 4dun4710
env_file:
.env
web:
build: .
ports:
- 5000:5000
environment:
ADUNATIO_PRIV_KEY: /code/privkey.pem
FLASK_DEBUG: 1
env_file:
.env
volumes:
- .:/code
volumes:
mongo_data:
mongo_data:
driver_opts:
device: /home/john/PycharmProjects/Adunatio/mongo_data_dir/
type: xfs
o: bind

@ -4,7 +4,6 @@ from flask_jwt_extended import JWTManager, create_access_token
from mongoengine import connect
from werkzeug.security import check_password_hash ,generate_password_hash
from internal_lib.AuthMethots import AuthJWT
from models.Account import Account
from models.Group import Group, PaymentGroup
from models.Payment import Payments

@ -1,9 +1,24 @@
from mongoengine import *
from models.Union import Union
from restapi import Methods
class Account(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('bank'),
("-bank"),
("union"),
('union', 'bank', "deleted")
],
}
union = ReferenceField(Union)
bank = StringField()
number = StringField()

@ -1,22 +1,52 @@
from mongoengine import *
from models.Union import Union
from restapi import Methods
class Group(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('name'),
("-name"),
("union","deleted"),
("union","deleted","name"),
],
}
union = ReferenceField(Union)
name = StringField(required=True)
rights = ListField(StringField(),required=True)
rights = ListField(StringField(), required=True)
deleted = BooleanField(default=False)
def __unicode__(self):
return "{} {}".format(self.union.name,self.name)
return "{} {}".format(self.union.name, self.name)
class PaymentGroup(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('name'),
("-name"),
("union"),
('union','name',"deleted")
],
}
union = ReferenceField(Union)
name = StringField(required=True)
deleted = BooleanField(default=False)
discount_percent = IntField(required=True)
def __unicode__(self):
return "{} {}".format(self.union.name, self.name)
return "{} {}".format(self.union.name, self.name)

@ -4,9 +4,26 @@ from models.Account import Account
from models.File import File
from models.Union import Union
from models.User import User
from restapi import Methods
class Payments(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
("union","deleted"),
("union","deleted","account"),
('user',"union"),
('user',"union","deleted"),
('union', "user","income","deleted"),
('union', "user","deleted")
],
}
"""
all payments income and outcome together!
"""

Loading…
Cancel
Save