From f4a8c5da0cb763ff6b9d3bf18842fca3de7c18b9 Mon Sep 17 00:00:00 2001 From: jcardozo Date: Mon, 16 Sep 2024 00:01:42 +0200 Subject: [PATCH] Refactor Dockerfile to separate devbox shell cmd and application tart Replaces the single CMD instruction with two separate commands: one to open the devbox shell and another to run the Spring Boot application server. This enhances modularity and ensures clean execution of each step. --- .devcontainer/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 23bfd7e..9e7de73 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,5 +16,7 @@ COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} ../devbox.lock /code/devbox.lock # Run devbox command to install packages based on the lock file RUN devbox run -- echo "Installed Packages." -# Set the default command to open devbox shell and run the Spring Boot application -CMD ["sh", "-c", ". ~/.devbox/shell && mvn spring-boot:run"] \ No newline at end of file +CMD ["devbox", "shell"] + +# Run the Spring Boot application server +CMD ["mvn spring-boot:run"] \ No newline at end of file