Skip to content

Commit 2862462

Browse files
authored
feat: make HTTP ports variable (#195)
1 parent 49e28e8 commit 2862462

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ services:
4343
ports:
4444
# HTTP
4545
- target: 80
46-
published: 80
46+
published: ${HTTP_PORT:-80}
4747
protocol: tcp
4848
# HTTPS
4949
- target: 443
50-
published: 443
50+
published: ${HTTPS_PORT:-443}
5151
protocol: tcp
5252
# HTTP/3
5353
- target: 443
54-
published: 443
54+
published: ${HTTP3_PORT:-443}
5555
protocol: udp
5656

5757
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service

docs/build.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ Use the `SERVER_NAME` environment variable to define your custom server name(s).
3131
SERVER_NAME="symfony.wip, caddy:80" docker-compose up --build
3232

3333
If you use Mercure, keep `caddy:80` in the list to allow the PHP container to request the caddy service.
34+
35+
## Using custom HTTP ports
36+
37+
Use the environment variables `HTTP_PORT`, `HTTPS_PORT` and/or `HTTP3_PORT` to adjust the ports to your needs, e.g.
38+
39+
HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker-compose up --build
40+
41+
to access your appplication on [https://localhost:4443](https://localhost:4443).

0 commit comments

Comments
 (0)