astarte-platform / astarte

Core Astarte Repository
https://docs.astarte-platform.org/
Apache License 2.0
236 stars 45 forks source link

Setup build for dev and prod #956

Closed shinnokdisengir closed 6 days ago

shinnokdisengir commented 1 month ago

Unified Dockerfile

All Dockerfiles in the project - apps - have been merged into one, as they were identical in 99% of their content. In addition, the new file configuration allows the develop section of docker compose to allow watch, with hotcode-reloading for those who need to develop

To build a container (default env is prod), you have to use the common Dockerfile in the app context:

docker build -f ../../Dockerfile .

To build in a different environment:

docker build --build-arg BUILD_ENV=dev -f ../../Dockerfile . docker build --build-arg BUILD_ENV=test -f ../../Dockerfile .

docker compose dev section

docker compose is now capable of starting containers in dev mode, without creating the release.

The previous docker-compose.yml file now points to the common Dockerfile located at the root of Astarte (see previous commit) A new docker-compose.dev.yml has been added, which, if started in cascade with the first, allows for the creation of a development environment for Astarte with the possibility of hot-reloading and rebuild, with each code change To start the dev mode functionality, according to the specifications (https://docs.docker.com/compose/multiple-compose-files/merge/)

docker compose -f docker-compose.yml -f docker-compose.dev.yml watch

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.49%. Comparing base (1a9c203) to head (87d67d4). Report is 5 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #956 +/- ## ========================================== + Coverage 67.99% 69.49% +1.50% ========================================== Files 281 267 -14 Lines 7420 6613 -807 ========================================== - Hits 5045 4596 -449 + Misses 2375 2017 -358 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.