From 07c5b2f9a0a7e2dc327d5ddfbc0df87188b6e83a Mon Sep 17 00:00:00 2001 From: lincmba Date: Thu, 18 Jul 2024 10:09:17 +0300 Subject: [PATCH] - Update Dockerfile - Update documentation with how to run using docker --- Dockerfile | 2 +- README.md | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e47722d..1d5dd60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,4 @@ COPY --from=build /app/exec/target/opensrp-gateway-plugin-exec.jar /app/ COPY resources/hapi_page_url_allowed_queries.json resources/hapi_page_url_allowed_queries.json COPY resources/hapi_sync_filter_ignored_queries.json resources/hapi_sync_filter_ignored_queries.json -CMD ["/app/opensrp-gateway-plugin-exec.jar"] +CMD ["/app/opensrp-gateway-plugin-exec.jar", "--server.max-http-header-size=40KB"] diff --git a/README.md b/README.md index 73846c2..2261ea2 100755 --- a/README.md +++ b/README.md @@ -229,12 +229,14 @@ environment variables ### Run project +#### Using Java Command + As documented on the Info Gateway modules [section here](https://github.com/google/fhir-gateway#modules), the command to run is: ```console -$ java -jar exec/target/opensrp-gateway-plugin-exec.jar --server.port=8081 --server.max-http-header-size=40KB +$ java -jar exec/target/opensrp-gateway-plugin-exec.jar --server.port=8080 --server.max-http-header-size=40KB ``` After a successful build, the built-in _Tomcat container_ will automatically @@ -242,6 +244,36 @@ deploy your _Spring Boot application_. You can access your application in a web browser by navigating to http://localhost:8080 (default) or the specified port in your application's configuration. +#### Using Docker + +To run the project using Docker, follow these steps: + +1. Build the Docker image: + +Navigate to the directory containing the Dockerfile and execute the following +command: + +```console +docker build -t opensrp-gateway-plugin . +``` + +2. Run the Docker container: + +Once the image is built, you can run the container with the following command: + +```console +docker run -p 8080:8080 opensrp-gateway-plugin +``` + +This command maps port 8080 on your host to port 8080 in the Docker container. +Adjust the port as necessary to match your configuration. + +3. Access the Application: + +After the container is running, you can access your application in a web browser +by navigating to http://localhost:8080 (or the specified port if you changed +it). + ### Tests To run the unit tests use the command below which both runs tests and generates