Skip to content
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
7 changes: 7 additions & 0 deletions mainline-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ RUN addgroup -g 82 -S www-data \

COPY nginx.conf /etc/nginx/nginx.conf
COPY drupal.conf /etc/nginx/conf.d/default.conf

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environment variables should be declared in Dockerfile.

ENV DOCROOT="/var/www/html" \
SERVER_NAME="_"

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
12 changes: 12 additions & 0 deletions mainline-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

# Configure docroot.
sed -i 's@%DOCROOT%@'"${DOCROOT}"'@' /etc/nginx/conf.d/*.conf
echo "Configured docroot to ${DOCROOT}."

# Set server name.
sed -i 's/%SERVER_NAME%/'"${SERVER_NAME}"'/' /etc/nginx/conf.d/*.conf
echo "Configured server name to ${SERVER_NAME}."

exec "$@"
5 changes: 2 additions & 3 deletions mainline-alpine/drupal.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
server_name _;
root /var/www/html;
server_name %SERVER_NAME%;
root %DOCROOT%;

location = /favicon.ico {
log_not_found off;
Expand Down Expand Up @@ -88,4 +88,3 @@ server {
log_not_found off;
}
}

7 changes: 7 additions & 0 deletions mainline/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ VOLUME /var/www/html

COPY nginx.conf /etc/nginx/nginx.conf
COPY drupal.conf /etc/nginx/conf.d/default.conf

ENV DOCROOT="/var/www/html" \
SERVER_NAME="_"

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
12 changes: 12 additions & 0 deletions mainline/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

# Configure docroot.
sed -i 's@%DOCROOT%@'"${DOCROOT}"'@' /etc/nginx/conf.d/*.conf
echo "Configured docroot to ${DOCROOT}."

# Set server name.
sed -i 's/%SERVER_NAME%/'"${SERVER_NAME}"'/' /etc/nginx/conf.d/*.conf
echo "Configured server name to ${SERVER_NAME}."

exec "$@"
5 changes: 2 additions & 3 deletions mainline/drupal.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
server_name _;
root /var/www/html;
server_name %SERVER_NAME%;
root %DOCROOT%;

location = /favicon.ico {
log_not_found off;
Expand Down Expand Up @@ -88,4 +88,3 @@ server {
log_not_found off;
}
}

7 changes: 7 additions & 0 deletions stable-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ RUN addgroup -g 82 -S www-data \

COPY nginx.conf /etc/nginx/nginx.conf
COPY drupal.conf /etc/nginx/conf.d/default.conf

ENV DOCROOT="/var/www/html" \
SERVER_NAME="_"

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
12 changes: 12 additions & 0 deletions stable-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

# Configure docroot.
sed -i 's@%DOCROOT%@'"${DOCROOT}"'@' /etc/nginx/conf.d/*.conf
echo "Configured docroot to ${DOCROOT}."

# Set server name.
sed -i 's/%SERVER_NAME%/'"${SERVER_NAME}"'/' /etc/nginx/conf.d/*.conf
echo "Configured server name to ${SERVER_NAME}."

exec "$@"
5 changes: 2 additions & 3 deletions stable-alpine/drupal.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
server_name _;
root /var/www/html;
server_name %SERVER_NAME%;
root %DOCROOT%;

location = /favicon.ico {
log_not_found off;
Expand Down Expand Up @@ -88,4 +88,3 @@ server {
log_not_found off;
}
}

7 changes: 7 additions & 0 deletions stable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ VOLUME /var/www/html

COPY nginx.conf /etc/nginx/nginx.conf
COPY drupal.conf /etc/nginx/conf.d/default.conf

ENV DOCROOT="/var/www/html" \
SERVER_NAME="_"

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
12 changes: 12 additions & 0 deletions stable/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

# Configure docroot.
sed -i 's@%DOCROOT%@'"${DOCROOT}"'@' /etc/nginx/conf.d/*.conf
echo "Configured docroot to ${DOCROOT}."

# Set server name.
sed -i 's/%SERVER_NAME%/'"${SERVER_NAME}"'/' /etc/nginx/conf.d/*.conf
echo "Configured server name to ${SERVER_NAME}."

exec "$@"
5 changes: 2 additions & 3 deletions stable/drupal.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
server_name _;
root /var/www/html;
server_name %SERVER_NAME%;
root %DOCROOT%;

location = /favicon.ico {
log_not_found off;
Expand Down Expand Up @@ -88,4 +88,3 @@ server {
log_not_found off;
}
}