Skip to content

feat: Update docker-compose to docker compose #13

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

Merged
merged 3 commits into from
Mar 12, 2025
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
6 changes: 3 additions & 3 deletions NGINX-SOAP-REST/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ NGINX Plus manages client requests based on service definitions provided by an e
This repo has been tested with:

- Linux VM
- Docker-compose v2.20.2+
- NGINX Plus R29+ license (`nginx-repo.crt` and `nginx-repo.key`)
- Docker compose v2.20.2+
- NGINX Plus R33+ license (`nginx-repo.crt`, `nginx-repo.key` and `license.jwt`)

## Current status / work in progress

Expand Down Expand Up @@ -64,7 +64,7 @@ To start the environment:
1. Run the startup script: during its first run it will build all Docker images

```
$ ./nginx-soap-rest.sh -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key
$ ./nginx-soap-rest.sh -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key -j ./license.jwt
[+] Running 6/6
[...]
✔ Network nginx-soap-rest_lab-network Created
Expand Down
3 changes: 1 addition & 2 deletions NGINX-SOAP-REST/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
openldap:
container_name: openldap
Expand Down Expand Up @@ -71,6 +69,7 @@ services:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/soaprest.js:/etc/nginx/conf.d/soaprest.js:ro
- ./nginx/soaprest.conf:/etc/nginx/conf.d/soaprest.conf:ro
- ${NGINX_JWT}:/etc/nginx/license.jwt:ro
- /dev/null:/etc/nginx/conf.d/default.conf:ro

secrets:
Expand Down
19 changes: 12 additions & 7 deletions NGINX-SOAP-REST/nginx-soap-rest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ $0 [options]\n\n
-h\t\t\t- This help\n
-o [start|stop]\t- Start/stop the lab\n
-C [file.crt]\t\t- Certificate file to pull packages from the official NGINX repository\n
-K [file.key]\t\t- Key file to pull packages from the official NGINX repository\n\n
-K [file.key]\t\t- Key file to pull packages from the official NGINX repository\n
-j [license.jwt]\t- JWT license for NGINX Plus R33+\n\n
=== Examples:\n\n
Lab start:\n
\t$0 -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key\n\n
\t$0 -o start -C /etc/ssl/nginx/nginx-repo.crt -K /etc/ssl/nginx/nginx-repo.key -j ./license.jwt\n\n
Lab stop:\n
\t$0 -o stop\n\n
"


while getopts 'ho:C:K:' OPTION
while getopts 'ho:C:K:j:' OPTION
do
case "$OPTION" in
h)
Expand All @@ -35,6 +36,9 @@ do
K)
export NGINX_KEY=$OPTARG
;;
j)
export NGINX_JWT=$OPTARG
;;
esac
done

Expand All @@ -46,18 +50,19 @@ fi

case $MODE in
'start')
if [ -z "${NGINX_CERT}" ] || [ -z "${NGINX_KEY}" ]
if [ -z "${NGINX_CERT}" ] || [ -z "${NGINX_KEY}" ] || [ -z "${NGINX_JWT}" ]
then
echo "Missing NGINX Plus certificate/key"
echo "Missing NGINX Plus certificate/key/jwt license"
exit
fi

DOCKER_BUILDKIT=1 docker-compose -p $PROJECT_NAME -f $DOCKERCOMPOSE up -d --remove-orphans
DOCKER_BUILDKIT=1 docker compose -p $PROJECT_NAME -f $DOCKERCOMPOSE up -d --remove-orphans
;;
'stop')
export NGINX_CERT="x"
export NGINX_KEY="x"
docker-compose -p $PROJECT_NAME -f $DOCKERCOMPOSE down
export NGINX_JWT="x"
docker compose -p $PROJECT_NAME -f $DOCKERCOMPOSE down
;;
*)
echo "$0 [start|stop]"
Expand Down