Skip to content

Commit

Permalink
Refactor Dockerfile to separate devbox shell cmd and application tart
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jcardozo committed Sep 15, 2024
1 parent 2f1e970 commit f4a8c5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
CMD ["devbox", "shell"]

# Run the Spring Boot application server
CMD ["mvn spring-boot:run"]

0 comments on commit f4a8c5d

Please sign in to comment.