diff --git a/nex-be/Dockerfile b/nex-be/Dockerfile index 0a77b4f..2f3b848 100644 --- a/nex-be/Dockerfile +++ b/nex-be/Dockerfile @@ -1,5 +1,7 @@ # 使用官方OpenJDK作为基础镜像 -FROM openjdk:11-jre-slim +FROM openjdk:8-jdk + +RUN apt-get update && apt-get install -y sudo systemd # 设置工作目录 WORKDIR /app @@ -8,7 +10,7 @@ WORKDIR /app COPY target/*.jar app.jar # 暴露应用端口 -EXPOSE 8080 +EXPOSE 8112 # 启动应用 ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/nex-be/docker-compose.yaml b/nex-be/docker-compose.yaml new file mode 100644 index 0000000..d129ecd --- /dev/null +++ b/nex-be/docker-compose.yaml @@ -0,0 +1,12 @@ +services: + app: + build: . + image: nex-be:1.0.3 + container_name: nex-be + ports: + - "8113:8112" + volumes: + - /var/lib/vdi/:/var/lib/vdi/ + environment: + - SPRING_PROFILES_ACTIVE=prod + restart: always \ No newline at end of file