Skip to content

Commit aee8b6c

Browse files
committed
Add docker compose and port override example
1 parent fa60b30 commit aee8b6c

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ You can substitute the certificate and private key with your own. This example u
2626
- /etc/ssl/private/ssl-cert-snakeoil.key:/app/privkey.pem
2727

2828

29+
## Choose your ports
30+
31+
You can choose a different internal port instead of 80 and 443 with the `HTTP_PORT` and `HTTPS_PORT` environment variables.
32+
33+
In this example I'm setting http to listen on 8888, and https to listen on 9999.
34+
35+
docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo
36+
37+
38+
With docker compose, this would be
39+
40+
my-http-listener:
41+
image: mendhak/http-https-echo
42+
environment:
43+
- HTTP_PORT=8888
44+
- HTTPS_PORT=9999
45+
ports:
46+
- "8080:8888"
47+
- "8443:9999"
48+
49+
2950

3051
## Output
3152

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
my-http-listener:
2+
image: mendhak/http-https-echo
3+
environment:
4+
- HTTP_PORT=8888
5+
- HTTPS_PORT=9999
6+
ports:
7+
- "8080:8888"
8+
- "8443:9999"
9+
# volumes:
10+
# - /etc/ssl/certs/ssl-cert-snakeoil.pem:/app/fullchain.pem
11+
# - /etc/ssl/private/ssl-cert-snakeoil.key:/app/privkey.pem

0 commit comments

Comments
 (0)