Skip to content

feat: make HTTP ports variable #195

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 2 commits into from
Dec 10, 2021
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 docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ services:
ports:
# HTTP
- target: 80
published: 80
published: ${HTTP_PORT:-80}
protocol: tcp
# HTTPS
- target: 443
published: 443
published: ${HTTPS_PORT:-443}
protocol: tcp
# HTTP/3
- target: 443
published: 443
published: ${HTTP3_PORT:-443}
protocol: udp

# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
Expand Down
8 changes: 8 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ Use the `SERVER_NAME` environment variable to define your custom server name(s).
SERVER_NAME="symfony.wip, caddy:80" docker-compose up --build

If you use Mercure, keep `caddy:80` in the list to allow the PHP container to request the caddy service.

## Using custom HTTP ports

Use the environment variables `HTTP_PORT`, `HTTPS_PORT` and/or `HTTP3_PORT` to adjust the ports to your needs, e.g.

HTTP_PORT=8000 HTTPS_PORT=4443 HTTP3_PORT=4443 docker-compose up --build

to access your appplication on [https://localhost:4443](https://localhost:4443).