修改bug

This commit is contained in:
wcq 2023-12-08 14:39:55 +08:00
parent 65e1d6c84e
commit b15a14e5b7
2 changed files with 59 additions and 33 deletions

View File

@ -1,52 +1,78 @@
version: '3.8'
services:
wd-smebiz:
build:
context: .
dockerfile: Dockerfile
volumes:
# 挂载日报代码
- ../wd-smebiz:/home/wd-smebiz
# 挂载静态文件目类
- /home/file/wd-smebiz/static_data:/home/wd-smebiz/static_data
- /home/file/wd-smebiz/static/upload_files:/home/wd-smebiz/static/upload_files
redis:
image: redis
container_name: redis
ports:
- "8008:8008"
- "6379:6379"
volumes:
- ./redis/data:/data
networks:
- app
command:
bash -c "cd /home/wd-smebiz && python3 main.py prod"
environment:
- TZ=Asia/Shanghai
depends_on:
- db
- redis
- app
db:
image: postgres
restart: always
container_name: postgres
environment:
POSTGRES_PASSWORD: 12345
POSTGRES_USER: postgres
networks:
- app
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgresql/data:/var/lib/postgresql/data
ports:
- "5432:5432" # Map PostgreSQL port 5432 to host port 5432
redis:
image: redis:latest
command: ["redis-server", "--appendonly", "yes"]
- "5432:5432"
# mongodb:
# image: mongo:6.0.9-rc1
# container_name: mongodb
# ports:
# - "27017:27017"
# networks:
# - app
# environment:
# MONGO_INITDB_ROOT_USERNAME: fecr
# MONGO_INITDB_ROOT_PASSWORD: fecr1988.wcq
# volumes:
# - ./mongodb/data:/data/db
wd-smebiz:
image: file-receive
container_name: file-receive
build:
context: ./file-receive
dockerfile: Dockerfile
volumes:
- redis_data:/data
- ./file-receive:/home/file-receive
ports:
- "6379:6379"
- "8041:8041"
networks:
- app
-
command:
bash -c "cd /home/file-receive && python3 main.py prod"
environment:
- TZ=Asia/Shanghai
depends_on:
- db
# nginx:
# image: nginx
# container_name: nginx
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx/html:/etc/nginx/html
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./nginx/cert:/etc/nginx/cert
# - ./nginx/logs:/var/log/nginx
# - ./nginx/web:/etc/nginx/web
# networks:
# - app
networks:
app:
external: true
volumes:
postgres_data:

View File

@ -56,7 +56,7 @@ def receive_subject_file_add_with_file(file: UploadFile = File(...), data: str =
data['template_path'] = ''
data['type'] = file_type
req = schemas.ReceiveSubjectFileAddReq(**data)
subject: ReceiveSubject = db.query(ReceiveSubject).filter(ReceiveSubject.id == req.D).first()
subject: ReceiveSubject = db.query(ReceiveSubject).filter(ReceiveSubject.id == req.subject_id).first()
folder_name = subject.folder_name
file_path = file_upload(file, static_path / folder_name, db)
req.template_path = file_path