-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from bryanlatten/feature-port-env
Dockerfile: added unprivileged port to ENV variables (as constant)
- Loading branch information
Showing
2 changed files
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ MAINTAINER Bryan Latten <[email protected]> | |
# Used with alternative CMD (worker.sh), leverages supervisor to maintain long-running processes | ||
ENV SIGNAL_BUILD_STOP=99 \ | ||
CONTAINER_ROLE=web \ | ||
CONTAINER_PORT=8080 \ | ||
CONF_NGINX_SITE="/etc/nginx/sites-available/default" \ | ||
CONF_NGINX_SERVER="/etc/nginx/nginx.conf" \ | ||
NOT_ROOT_USER=www-data \ | ||
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \ | ||
S6_KILL_FINISH_MAXTIME=5000 \ | ||
S6_KILL_GRACETIME=3000 | ||
|
||
|
||
# Ensure base system is up to date | ||
RUN apt-get update && \ | ||
apt-get upgrade -yqq && \ | ||
|
@@ -46,10 +46,12 @@ COPY ./container/root / | |
|
||
# Add S6 overlay build, to avoid having to build from source | ||
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \ | ||
rm /tmp/s6-overlay-amd64.tar.gz | ||
rm /tmp/s6-overlay-amd64.tar.gz && \ | ||
# Set nginx to listen on defined port \ | ||
sed -i "s/listen [0-9]*;/listen ${CONTAINER_PORT};/" $CONF_NGINX_SITE | ||
|
||
# Using a non-privileged port to prevent having to use setcap internally | ||
EXPOSE 8080 | ||
EXPOSE ${CONTAINER_PORT} | ||
|
||
# NOTE: intentionally NOT using s6 init as the entrypoint | ||
# This would prevent container debugging if any of those service crash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters