mirror of
https://github.com/tiennm99/store-scraper-bot.git
synced 2026-10-11 03:13:50 +00:00
feat(docker): use distTar instead of fatjar
This commit is contained in:
1 parent
7335c2757e
commit
bccc6f647e
2 files changed
+4
-9
No files matched your search
+4
-4
@@ -11,8 +11,7 @@ WORKDIR /build
|
|||||||
COPY ./src src/
|
COPY ./src src/
|
||||||
RUN --mount=type=cache,target=/root/.gradle \
|
RUN --mount=type=cache,target=/root/.gradle \
|
||||||
--mount=type=cache,target=/build/build \
|
--mount=type=cache,target=/build/build \
|
||||||
./gradlew build -x check -x test --no-daemon --parallel --build-cache && \
|
./gradlew distTar -x check -x test --no-daemon --parallel --build-cache
|
||||||
mv build/libs/*-all.jar app.jar
|
|
||||||
|
|
||||||
FROM eclipse-temurin:21.0.9_10-jre-alpine AS final
|
FROM eclipse-temurin:21.0.9_10-jre-alpine AS final
|
||||||
ARG UID=10001
|
ARG UID=10001
|
||||||
@@ -26,5 +25,6 @@ RUN adduser \
|
|||||||
appuser
|
appuser
|
||||||
USER appuser
|
USER appuser
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=package /build/app.jar app.jar
|
COPY --from=package /build/build/distributions/*.tar.gz app.tar.gz
|
||||||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
|
RUN tar -xzf app.tar.gz --strip-components=1 && rm app.tar.gz
|
||||||
|
ENTRYPOINT ["sh", "-c", "bin/com.miti99.storescraperbot"]
|
||||||
@@ -2,7 +2,6 @@ plugins {
|
|||||||
application
|
application
|
||||||
idea
|
idea
|
||||||
java
|
java
|
||||||
id("com.gradleup.shadow") version "8.3.5"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.miti99"
|
group = "com.miti99"
|
||||||
@@ -58,10 +57,6 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
// tasks.shadowJar {
|
|
||||||
// transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer())
|
|
||||||
// }
|
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user