steve
steve copied to clipboard
Fix Dockerfile for k8s mvnw Not Found Error , Optimize Image Size with Multi-Stage Build and SERVER_HOST
This PR introduces three main improvements to the Dockerfile:
- Fix Dockerfile Errors:
- Added the following lines to ensure that the Maven Wrapper (mvnw) and the Maven directory (.mvn) are included in the image during the build process.
- Optimized Dockerfile with Multi-Stage Build:
- Refactored the Dockerfile to utilize a multi-stage build process. This separates the build and release stages, which helps to reduce the final image size by including only the necessary files in the runtime image.
- Introduce SERVER_HOST Environment Variable:
- Added a new environment variable SERVER_HOST to allow configuration of the server's bind address. This will enhance flexibility in deployment scenarios.
Duplicate of #1319
@MingShyanWei thanks for this!
@juherr what to do about the other PR? it is still a draft. which one should be accept?
@goekay It was in draft because waiting for tests/feedbacks. It should work but I didn't test on my own side yet. I can do it soon or feel free to merge if it is working for you.
i updated this PR (since it was more recent) with some inspiration from https://github.com/steve-community/steve/pull/1319
therefore, this one supersedes it.