Skip to content

Commit

Permalink
- Update Dockerfile
Browse files Browse the repository at this point in the history
- Update documentation with how to run using docker
  • Loading branch information
lincmba committed Jul 23, 2024
1 parent 77181dc commit 07c5b2f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,51 @@ 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
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
Expand Down

0 comments on commit 07c5b2f

Please sign in to comment.