Files
spring-async-demo/scheduling/Dockerfile
Ankur Mhatre eaa8171966 Add the scheduling module
Three replicas of one application against one PostgreSQL database, proving
duplicate @Scheduled execution and then removing it with ShedLock: 24
executions where 8 were due, then 7 for 7 ticks.

Also measured: @SchedulerLock without @EnableSchedulerLock does nothing and
warns about nothing; spring.task.scheduling.pool.size=1 does not starve a
fixedRate job but delays it and fires 35 of 40 executions in a burst; and a
node whose clock is 40 seconds fast takes a live lock unless the provider
uses usingDbTime().
2026-09-01 23:32:16 +05:30

16 lines
644 B
Docker

# Used only by docker-compose.yml. The committed transcripts under docs/output/ were produced
# without Docker, by scripts/three-replicas.sh against the PostgreSQL that scripts/postgres.sh
# unpacks into target/.
FROM eclipse-temurin:25-jdk AS build
WORKDIR /src
COPY pom.xml .
RUN --mount=type=cache,target=/root/.m2 \
apt-get update && apt-get install -y --no-install-recommends maven && \
mvn -B -q dependency:go-offline
COPY src ./src
RUN --mount=type=cache,target=/root/.m2 mvn -B -q -DskipTests package
FROM eclipse-temurin:25-jre
COPY --from=build /src/target/scheduling-1.0.jar /app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]