mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
добавление редисаъ3
This commit is contained in:
@@ -2,7 +2,7 @@ from pydantic_settings import BaseSettings
|
||||
from typing import Optional
|
||||
|
||||
class Settings(BaseSettings):
|
||||
DATABASE_URL: str = "postgresql://postgres:postgres@db:5432/support_db"
|
||||
DATABASE_URL: str = "postgresql://postgres:postgres123@db:5432/support_db"
|
||||
REDIS_URL: str = "redis://redis:6379/0"
|
||||
|
||||
# JWT settings
|
||||
|
@@ -1,25 +1,21 @@
|
||||
"""Employee schemas"""
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional
|
||||
|
||||
class EmployeeBase(BaseModel):
|
||||
first_name: str
|
||||
last_name: str
|
||||
department: str
|
||||
office: str
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
class EmployeeCreate(EmployeeBase):
|
||||
password: str
|
||||
|
||||
class EmployeeUpdate(BaseModel):
|
||||
first_name: str | None = None
|
||||
last_name: str | None = None
|
||||
department: str | None = None
|
||||
office: str | None = None
|
||||
password: str | None = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
class EmployeeUpdate(EmployeeBase):
|
||||
password: Optional[str] = None
|
||||
|
||||
class EmployeeResponse(EmployeeBase):
|
||||
id: int
|
||||
class Employee(EmployeeBase):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
hashed_password: str
|
@@ -21,7 +21,7 @@ services:
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://postgres:postgres@db:5432/support_db
|
||||
- DATABASE_URL=postgresql://postgres:postgres123@db:5432/support_db
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
depends_on:
|
||||
- db
|
||||
@@ -34,8 +34,10 @@ services:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_PASSWORD=postgres123
|
||||
- POSTGRES_DB=support_db
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
redis:
|
||||
container_name: support-redis
|
||||
|
@@ -12,11 +12,11 @@ COPY backend/ .
|
||||
# Создаем entrypoint скрипт
|
||||
RUN echo '#!/bin/sh\n\
|
||||
echo "Waiting for database..."\n\
|
||||
sleep 5\n\
|
||||
sleep 10\n\
|
||||
echo "Running database migrations..."\n\
|
||||
alembic upgrade head\n\
|
||||
echo "Starting application..."\n\
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload' > /entrypoint.sh \
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload --workers 1' > /entrypoint.sh \
|
||||
&& chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 8000
|
||||
|
Reference in New Issue
Block a user