修改bug
This commit is contained in:
parent
65e1d6c84e
commit
b15a14e5b7
|
@ -1,52 +1,78 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
wd-smebiz:
|
redis:
|
||||||
build:
|
image: redis
|
||||||
context: .
|
container_name: redis
|
||||||
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
|
|
||||||
ports:
|
ports:
|
||||||
- "8008:8008"
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- ./redis/data:/data
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
command:
|
|
||||||
bash -c "cd /home/wd-smebiz && python3 main.py prod"
|
|
||||||
environment:
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- redis
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: always
|
container_name: postgres
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_PASSWORD: 12345
|
POSTGRES_PASSWORD: 12345
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- ./postgresql/data:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432" # Map PostgreSQL port 5432 to host port 5432
|
- "5432:5432"
|
||||||
redis:
|
|
||||||
image: redis:latest
|
# mongodb:
|
||||||
command: ["redis-server", "--appendonly", "yes"]
|
# 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:
|
volumes:
|
||||||
- redis_data:/data
|
- ./file-receive:/home/file-receive
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "8041:8041"
|
||||||
networks:
|
networks:
|
||||||
- app
|
- 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:
|
networks:
|
||||||
app:
|
app:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ def receive_subject_file_add_with_file(file: UploadFile = File(...), data: str =
|
||||||
data['template_path'] = ''
|
data['template_path'] = ''
|
||||||
data['type'] = file_type
|
data['type'] = file_type
|
||||||
req = schemas.ReceiveSubjectFileAddReq(**data)
|
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
|
folder_name = subject.folder_name
|
||||||
file_path = file_upload(file, static_path / folder_name, db)
|
file_path = file_upload(file, static_path / folder_name, db)
|
||||||
req.template_path = file_path
|
req.template_path = file_path
|
||||||
|
|
Loading…
Reference in New Issue