File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed
Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ RUN /workspace/gradlew -x test shadowJar --no-daemon
2020FROM eclipse-temurin:17-jre
2121WORKDIR /app
2222
23- # Copy application JAR
24- COPY --from=build /workspace/build/libs/*.jar /app/app.jar
23+ # Copy application JAR (shadow/fat JAR only)
24+ COPY --from=build /workspace/build/libs/*-all .jar /app/app.jar
2525
2626# Copy classpath resources (including static assets) alongside the JAR
2727COPY --from=build /workspace/src/main/resources/ /app/resources/
Original file line number Diff line number Diff line change @@ -36,23 +36,12 @@ fun Application.module() {
3636 appConfig.port
3737 )
3838
39- // Lazy initialization: Firestore connects on first use, not at startup
40- val firestoreLazy = lazy {
41- try {
42- FirestoreProvider .create(appConfig)
43- } catch (e: Exception ) {
44- log.error(" Failed to initialize Firestore - some features may be unavailable" , e)
45- throw e
46- }
47- }
48- val firestore by firestoreLazy
49- val portfolioMetaService by lazy { PortfolioMetaService (PortfolioMetaRepository (firestore)) }
39+ val firestore = FirestoreProvider .create(appConfig)
40+ val portfolioMetaService = PortfolioMetaService (PortfolioMetaRepository (firestore))
5041
5142 environment.monitor.subscribe(ApplicationStopped ) {
52- if (firestoreLazy.isInitialized()) {
53- runCatching { firestore.close() }
54- .onFailure { throwable -> log.warn(" Failed to close Firestore" , throwable) }
55- }
43+ runCatching { firestore.close() }
44+ .onFailure { throwable -> log.warn(" Failed to close Firestore" , throwable) }
5645 }
5746
5847 install(DefaultHeaders )
You can’t perform that action at this time.
0 commit comments