mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
добавление редисаъ2
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
fastapi>=0.68.0,<0.69.0
|
fastapi==0.110.0
|
||||||
uvicorn>=0.15.0,<0.16.0
|
uvicorn==0.27.1
|
||||||
sqlalchemy>=1.4.23,<1.5.0
|
sqlalchemy==2.0.27
|
||||||
pydantic>=1.8.0,<2.0.0
|
pydantic==2.6.3
|
||||||
python-jose[cryptography]>=3.3.0,<4.0.0
|
pydantic-settings==2.2.1
|
||||||
passlib[bcrypt]>=1.7.4,<2.0.0
|
python-multipart==0.0.9
|
||||||
python-multipart>=0.0.5,<0.0.6
|
python-jose[cryptography]==3.3.0
|
||||||
redis>=4.0.0,<5.0.0
|
passlib[bcrypt]>=1.7.4
|
||||||
python-dotenv>=0.19.0,<0.20.0
|
bcrypt>=4.0.1
|
||||||
psycopg2-binary>=2.9.1,<3.0.0
|
redis>=4.0.0
|
||||||
requests>=2.26.0,<3.0.0
|
python-dotenv==1.0.1
|
||||||
|
psycopg2-binary==2.9.9
|
||||||
|
alembic==1.13.1
|
||||||
|
pytest==8.0.0
|
||||||
|
httpx==0.26.0
|
||||||
|
requests>=2.26.0
|
||||||
@@ -8,10 +8,8 @@ services:
|
|||||||
dockerfile: docker/frontend/Dockerfile
|
dockerfile: docker/frontend/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./certbot/www:/var/www/certbot/:ro
|
- ./frontend:/app
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
@@ -42,8 +40,6 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
container_name: support-redis
|
container_name: support-redis
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
ports:
|
|
||||||
- "6379:6379"
|
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
|
|
||||||
|
|||||||
@@ -2,29 +2,23 @@ FROM python:3.11-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
# Устанавливаем зависимости
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
gcc \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Create logs directory
|
|
||||||
RUN mkdir -p /app/logs
|
|
||||||
|
|
||||||
# Copy requirements first to leverage Docker cache
|
|
||||||
COPY backend/requirements.txt .
|
COPY backend/requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy application code
|
# Копируем код приложения
|
||||||
COPY backend/ .
|
COPY backend/ .
|
||||||
|
|
||||||
# Make entrypoint script executable
|
# Создаем entrypoint скрипт
|
||||||
COPY docker/backend/entrypoint.sh /entrypoint.sh
|
RUN echo '#!/bin/sh\n\
|
||||||
RUN chmod +x /entrypoint.sh
|
echo "Waiting for database..."\n\
|
||||||
|
sleep 5\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 \
|
||||||
|
&& chmod +x /entrypoint.sh
|
||||||
|
|
||||||
# Create volume for logs
|
|
||||||
VOLUME ["/app/logs"]
|
|
||||||
|
|
||||||
# Expose the port the app runs on
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
CMD ["/entrypoint.sh"]
|
||||||
@@ -2,31 +2,6 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name itformhelp.ru;
|
server_name itformhelp.ru;
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name itformhelp.ru;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/itformhelp.ru/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/itformhelp.ru/privkey.pem;
|
|
||||||
|
|
||||||
# Улучшенные настройки SSL
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_prefer_server_ciphers off;
|
|
||||||
|
|
||||||
# Настройки CORS
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
|
||||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
|
|||||||
Reference in New Issue
Block a user