Skip to content

Commit

Permalink
[Docker] Allow to define port via HTTP_PORT (#2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bockiii authored Oct 9, 2021
1 parent 11be390 commit 793c55f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ while IFS= read -r -d '' file; do
esac
done

# This feature can set the internal port that apache uses to something else.
# If docker is run on network:service mode, no two containers can use port 80
# To use this, start the container with the additional environment variable "HTTP_PORT"
if [ ! -z ${HTTP_PORT} ]; then
sed -i "s/80/$HTTP_PORT/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
fi


# Start apache
apache2-foreground

0 comments on commit 793c55f

Please sign in to comment.