Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP-1450 Add Wiremock and Localstack setups and workflows #59

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- hmpps-devops-tools
- hmpps-mssql-tools
- hmpps-mysql-tools
- hmpps-wiremock
- hmpps-localstack
- hmpps-clamav
- hmpps-python-deps
permissions:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/trivy_scan_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- hmpps-mssql-tools
- hmpps-mysql-tools
- hmpps-clamav
- hmpps-wiremock
- hmpps-localstack
permissions:
packages: write
contents: read
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

These images are built in github actions see `.github/workflows/docker-build-push.yml` - and they are pushed to github packages.

| Dockerfile dir | Description | github package |
| --- | --- | --- |
| `hmpps-devops-tools` | contains various useful tools (az cli, aws cli, kubectl, helm), runs as non-root | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-devops-tools> |
| `hmpps-mssql-tools` | contains mssql-tools and az cli. For sqlserver db refresh jobs | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-mssql-tools> |
| `hmpps-mysql-tools` | contains mysql-client and aws cli. For mysql db refresh jobs, runs as non-root | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-mysql-tools> |
| `hmpps-clamav` | ClamAV base image, see README in folder | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-clamav> |
| `hmpps-clamav-freshclammed` | ClamAV image, twice daily updated virus DB, see README in folder | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-clamav-freshclammed> |
| `hmpps-python-deps` | Python install with dependencies for running python scripts | <https://github.com/ministryofjustice/hmpps-utility-container-images/pkgs/container/hmpps-python-deps> |
| Dockerfile dir | Description | github package |
|-----------------------------|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| `hmpps-devops-tools` | contains various useful tools (az cli, aws cli, kubectl, helm), runs as non-root | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-devops-tools> |
| `hmpps-mssql-tools` | contains mssql-tools and az cli. For sqlserver db refresh jobs | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-mssql-tools> |
| `hmpps-mysql-tools` | contains mysql-client and aws cli. For mysql db refresh jobs, runs as non-root | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-mysql-tools> |
| `hmpps-wiremock` | contains a CP friendly wiremock docker image. Runs as non-root and can add new responses as required | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-wiremock> |
| `hmpps-localstack` | contains a CP localstack. Runs as non-root | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-localstack> |
| `hmpps-clamav` | ClamAV base image, see README in folder | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-clamav> |
| `hmpps-clamav-freshclammed` | ClamAV image, twice daily updated virus DB, see README in folder | <https://github.com/ministryofjustice/hmpps-tools-images/pkgs/container/hmpps-clamav-freshclammed> |
| `hmpps-python-deps` | Python install with dependencies for running python scripts | <https://github.com/ministryofjustice/hmpps-utility-container-images/pkgs/container/hmpps-python-deps> |

## Trivy Scan

Expand Down
5 changes: 5 additions & 0 deletions hmpps-localstack/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM localstack/localstack:stable
RUN chown localstack:localstack -R /tmp/localstack && \
chown localstack:localstack -R /var/lib/localstack
USER 1000

7 changes: 7 additions & 0 deletions hmpps-wiremock/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM wiremock/wiremock:latest
RUN addgroup --gid 2000 --system wiremock && adduser --uid 2000 --system wiremock --gid 2000

COPY --chown=wiremock:wiremock wiremock /home/wiremock

USER 2000
ENTRYPOINT ["/docker-entrypoint.sh", "--port=8090", "--global-response-templating", "--disable-gzip", "--verbose"]
19 changes: 19 additions & 0 deletions hmpps-wiremock/wiremock/__files/attribute-search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"empty": true,
"totalPages": 0,
"totalElements": 0,
"first": true,
"last": true,
"size": 0,
"number": 0,
"numberOfElements": 10,
"pageable": {
"offset": 0,
"pageSize": 0,
"paged": true,
"pageNumber": 0,
"unpaged": true
},
"content": [
]
}
3 changes: 3 additions & 0 deletions hmpps-wiremock/wiremock/__files/ping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"status": "UP"
}
13 changes: 13 additions & 0 deletions hmpps-wiremock/wiremock/mappings/atrribute-search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "POST",
"urlPath": "/attribute-search"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"bodyFileName": "attribute-search.json"
}
}
13 changes: 13 additions & 0 deletions hmpps-wiremock/wiremock/mappings/ping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "GET",
"urlPath": "/health/ping"
},
"response": {
"status": 200,
"bodyFileName": "ping.json",
"headers": {
"Content-Type": "application/json"
}
}
}
Loading