fix docker bug

This commit is contained in:
luke 2025-05-21 17:49:04 +08:00
parent 35b4981ebf
commit c448c24cd2
3 changed files with 22 additions and 3 deletions

View File

@ -5,7 +5,9 @@ FROM openjdk:11-jdk-slim
WORKDIR /app WORKDIR /app
# 拷贝 JAR # 拷贝 JAR
COPY doc-parser-server-0.0.1-SNAPSHOT.jar app.jar COPY doc-parser-server-0.0.1-SNAPSHOT.jar /app/
EXPOSE 18080
# 启动命令:指定 spring.profiles.active=docker # 启动命令:指定 spring.profiles.active=docker
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"] CMD ["java", "-Djdk.attach.allowAttachSelf=true", "-Dspring.profiles.active=docker", "-jar", "doc-parser-server-0.0.1-SNAPSHOT.jar"]

View File

@ -0,0 +1,17 @@
version: '3'
services:
document-parser:
image: document-parser:latest
build:
context: ./docker-document-parser-java
container_name: document-parser
volumes:
- "D:/02-documents/01-ahnx-share-src-public/public:/app/import-data"
- "D:/00-projects/00-micro-sass/docker-document-parser-java/logs:/app/doc-parser-server-log"
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "18080:18080"
command: java -Dspring.profiles.active=docker -Djdk.attach.allowAttachSelf=true -jar doc-parser-server-0.0.1-SNAPSHOT.jar
restart: always

View File

@ -27,4 +27,4 @@ pdf.path=/app/import-data
word.path=/app/import-data word.path=/app/import-data
# 相对路径裁剪 # 相对路径裁剪
exclude-file-path-prefix=/app/ exclude.file.path.prefix=/app/