#FROM maven:3.9.1-eclipse-temurin-20-alpine as build
#WORKDIR /workspace
#COPY pom.xml .
#COPY src src
#RUN --mount=type=cache,target=/root/.m2,id=m2,sharing=locked \
#mvn package -Dmaven.test.skip
#RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
#
#FROM docker.io/eclipse-temurin:21-jre-alpine
FROM mcr.microsoft.com/playwright/java:v1.47.0-noble
WORKDIR /app
COPY target/dependency/BOOT-INF/lib /app/lib
COPY target/dependency/META-INF /app/META-INF
COPY target/dependency/BOOT-INF/classes /app
RUN ls

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

ENTRYPOINT ["java","-cp","/app:/app/lib/*","jj.tech.paolu.Application","--spring.profiles.active=prod"]