Browse Source

Merge pull request #2440 from nginx-proxy/web-image-alpine

test: use python alpine variant as base for web image
Nicolas Duchon 1 year ago
parent
commit
c4c65a4441
2 changed files with 6 additions and 5 deletions
  1. 2 1
      test/requirements/web/Dockerfile
  2. 4 4
      test/requirements/web/entrypoint.sh

+ 2 - 1
test/requirements/web/Dockerfile

@@ -1,6 +1,7 @@
 # Docker Image running one (or multiple) webservers listening on all given ports from WEB_PORTS environment variable
 
-FROM python:3
+FROM python:3-alpine
+RUN apk add --no-cache bash
 COPY ./webserver.py /
 COPY ./entrypoint.sh /
 WORKDIR /opt

+ 4 - 4
test/requirements/web/entrypoint.sh

@@ -5,11 +5,11 @@ trap '[ ${#PIDS[@]} -gt 0 ] && kill -TERM ${PIDS[@]}' TERM
 declare -a PIDS
 
 for port in $WEB_PORTS; do
-	echo starting a web server listening on port $port;
-	/webserver.py $port &
+	echo starting a web server listening on port "$port";
+	/webserver.py "$port" &
 	PIDS+=($!)
 done
 
-wait ${PIDS[@]}
+wait "${PIDS[@]}"
 trap - TERM
-wait ${PIDS[@]}
+wait "${PIDS[@]}"