From de33352618d885e745428d98c9c2a5d13f1a128d Mon Sep 17 00:00:00 2001 From: fede Date: Wed, 5 Aug 2026 23:15:27 -0300 Subject: [PATCH] fix: el docker no creaba imagenes nuevas --- comms/Dockerfile | 10 +++++++++- .../scala/com/fede/comms/config/EnvFile.scala | 15 ++++++++------- docker-compose.yml | 5 +++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/comms/Dockerfile b/comms/Dockerfile index dc9646e..5d69c5d 100644 --- a/comms/Dockerfile +++ b/comms/Dockerfile @@ -1,8 +1,16 @@ +FROM sbtscala/scala-sbt:amazoncorretto-al2023-21.0.12_1.12.14_2.13.18 AS builder + +WORKDIR /app + +COPY . . + +RUN sbt assembly + FROM eclipse-temurin:21-jre WORKDIR /app -COPY target/scala-2.13/*assembly*.jar app.jar +COPY --from=builder /app/target/scala-2.13/*assembly*.jar app.jar EXPOSE 8080 diff --git a/comms/src/main/scala/com/fede/comms/config/EnvFile.scala b/comms/src/main/scala/com/fede/comms/config/EnvFile.scala index 1e6853d..8067894 100644 --- a/comms/src/main/scala/com/fede/comms/config/EnvFile.scala +++ b/comms/src/main/scala/com/fede/comms/config/EnvFile.scala @@ -5,14 +5,15 @@ import scala.io.Source object EnvFile { - def load(path: String): Map[String, String] = { - val file = new File(path) - if (!file.exists()) Map.empty - else { - val lines = Source.fromFile(file).getLines().toList - lines.flatMap(parseLine).toMap - } +def load(path: String): Map[String, String] = { + val file = new File(path) + if (!file.exists()) { + sys.env + } else { + val lines = Source.fromFile(file).getLines().toList + lines.flatMap(parseLine).toMap } +} private def parseLine(line: String): Option[(String, String)] = { val trimmed = line.trim diff --git a/docker-compose.yml b/docker-compose.yml index fdcf79b..d95422c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: depends_on: - svelte - go-api + - comms restart: on-failure networks: - app-network @@ -45,8 +46,8 @@ services: - "8088:8088" env_file: - ./comms/.env - depends_on: - - go-api + # depends_on: + # - go-api restart: on-failure networks: - app-network