Files
iot-test-platform/Dockerfile

26 lines
618 B
Docker
Raw Normal View History

2025-12-12 16:04:30 +08:00
# Build Stage
FROM maven:3.9.9-eclipse-temurin-17 AS build
WORKDIR /app
2025-12-12 17:12:45 +08:00
# 使用自定义 Maven 设置(如阿里云镜像)加速构建
COPY settings.xml /usr/share/maven/conf/settings.xml
2025-12-12 16:04:30 +08:00
COPY pom.xml .
COPY src ./src
RUN mvn -B clean package -DskipTests
2025-12-12 11:45:17 +08:00
# Run Stage
FROM eclipse-temurin:17-jre-alpine
WORKDIR /app
VOLUME /tmp
2025-12-12 16:04:30 +08:00
# Copy the built jar from the build stage
COPY --from=build /app/target/*.jar app.jar
2025-12-12 11:45:17 +08:00
# Expose Web Port and JT808 TCP Port
EXPOSE 8080
EXPOSE 20048
# Run the application
2025-12-18 10:22:27 +08:00
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=Asia/Shanghai","-jar","app.jar"]