Skip to content
Open
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
3 changes: 2 additions & 1 deletion ubuntu-7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RUN \
##
# Install composer
##
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --1 \
&& composer global require hirak/prestissimo \

##
Expand Down Expand Up @@ -115,6 +115,7 @@ ENV \
# This also works correctly with flynn:
# https://github.com/flynn/flynn/issues/3213#issuecomment-237307457
PORT="8080" \
INTERNAL_PORT="8888" \
# Use custom users for nginx and php-fpm
WEB_USER="wordpress" \
WEB_GROUP="web" \
Expand Down
2 changes: 1 addition & 1 deletion ubuntu-7.4/rootfs/etc/cont-init.d/00-render-templates
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ echo "[cont-init.d] Substituting env into configuration files..."
##
# Nginx doesn't support env variables in config files so we will have to do this in hacky way instead
##
VARS='$PORT:$WEB_ROOT:$WEB_USER:$WEB_GROUP:$NGINX_ACCESS_LOG:$NGINX_ERROR_LOG:$NGINX_ERROR_LEVEL:$NGINX_INCLUDE_DIR:$NGINX_MAX_BODY_SIZE:$NGINX_BODY_BUFFER_SIZE:$NGINX_FASTCGI_TIMEOUT:$WP_ENV:$NGINX_CACHE_KEY'
VARS='$PORT:$INTERNAL_PORT:$WEB_ROOT:$WEB_USER:$WEB_GROUP:$NGINX_ACCESS_LOG:$NGINX_ERROR_LOG:$NGINX_ERROR_LEVEL:$NGINX_INCLUDE_DIR:$NGINX_MAX_BODY_SIZE:$NGINX_BODY_BUFFER_SIZE:$NGINX_FASTCGI_TIMEOUT:$WP_ENV:$NGINX_CACHE_KEY'
render_env_tmpl "$VARS" /etc/nginx/nginx.conf

##
Expand Down
1 change: 1 addition & 0 deletions ubuntu-7.4/rootfs/etc/nginx/env.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Set custom enviromental variables that we need with lua here
# These are used to dynamically load
env PORT;
env INTERNAL_PORT;
env WEB_ROOT;
env NGINX_MAX_BODY_SIZE;
env NGINX_TIMEOUT;
Expand Down
18 changes: 17 additions & 1 deletion ubuntu-7.4/rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,26 @@ http {
pagespeed LoadFromFile "$scheme://$host/wp-content/themes/" "${WEB_ROOT}/wp/wp-content/themes/";

server {
# This is the default server for this container
# This is an internal proxy for the main server
listen ${PORT} default_server;
server_name _;

location / {
proxy_set_header Host $host;

# Include custom proxy configs from project
include ${NGINX_INCLUDE_DIR}/proxy/*.conf;
include ${NGINX_INCLUDE_DIR}/environments/${WP_ENV}/proxy/*.conf;

proxy_pass http://127.0.0.1:${INTERNAL_PORT};
}
}

server {
# This is the default server for this container
listen 127.0.0.1:${INTERNAL_PORT};
server_name _;

root ${WEB_ROOT};

# Use index.php if it exists but also allow static websites in subfolders
Expand Down