Fix Dockerfile.local except volumes

This commit is contained in:
Guntis Smaukstelis
2025-03-01 18:16:56 +02:00
parent 4bd3733781
commit f0c5d2c42b
5 changed files with 21 additions and 10 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ FROM amazoncorretto:17-alpine
WORKDIR /app WORKDIR /app
COPY ./web/dist/ web/dist/ COPY ./web/dist/ web/dist/
COPY ./target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar app.jar COPY ./target/scala-2.13/app.jar app.jar
VOLUME /app/data VOLUME /app/data
+3 -5
View File
@@ -7,11 +7,9 @@ RUN sbt clean assembly
FROM amazoncorretto:17-alpine FROM amazoncorretto:17-alpine
WORKDIR /app COPY --from=build /app/web/dist/ /web/dist/
COPY --from=build /app/target/scala-2.13/app.jar /app.jar
COPY --from=build /app/web/dist/ web/dist/ VOLUME /data
COPY --from=build /app/target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar app.jar
VOLUME /app/data
CMD ["java", "-jar", "app.jar"] CMD ["java", "-jar", "app.jar"]
+2 -2
View File
@@ -7,8 +7,8 @@ Rename `.env-sample` to `.env` and fill in credentials
## Run ## Run
``` ```
docker-compose up node --build docker-compose up --build node
docker-compose up scala --build docker-compose up --build scala
``` ```
## Web ## Web
+12 -1
View File
@@ -5,7 +5,18 @@ ThisBuild / scalaVersion := "2.13.10"
lazy val root = (project in file(".")) lazy val root = (project in file("."))
.settings( .settings(
name := "WeatherTool", name := "WeatherTool",
Compile / mainClass := Some("Main") Compile / mainClass := Some("Main"),
// Assembly settings for consistent JAR name
assembly / assemblyJarName := "app.jar",
// Merge strategy for assembly to handle conflicts
assembly / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case "module-info.class" => MergeStrategy.discard
case x if x.endsWith(".conf") => MergeStrategy.concat
case x => MergeStrategy.first
}
) )
val doobieVersion = "1.0.0-RC1" val doobieVersion = "1.0.0-RC1"
+3 -1
View File
@@ -83,8 +83,10 @@ object GribParser {
hour = bytes(16) hour = bytes(16)
minute = bytes(17) minute = bytes(17)
second = bytes(18) second = bytes(18)
currentMonth = ZonedDateTime.now(ZoneOffset.UTC).getMonthValue()
validMonth = if (month < 1 || month > 12) currentMonth else month
referenceTime = ZonedDateTime.of( referenceTime = ZonedDateTime.of(
year, month, day, year, validMonth, day,
hour, minute, second, 0, // last 0 is nanos hour, minute, second, 0, // last 0 is nanos
ZoneOffset.UTC // This is what 'Z' represents - UTC/Zero offset ZoneOffset.UTC // This is what 'Z' represents - UTC/Zero offset
) )