Skip to content

Commit

Permalink
Set DocumentRoot subdirectory with env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanii committed May 24, 2019
1 parent 6527b4a commit ddc3187
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions 7.3.2-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ RUN { \
echo 'date.timezone=UTC'; \
} > /usr/local/etc/php/conf.d/php.ini

ENV DOCROOTSUB=""
ENV PORT 8080
ENV SSH_PORT 2222
EXPOSE 2222 8080
Expand Down
2 changes: 1 addition & 1 deletion 7.3.2-apache/apache2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Listen {PORT}
Require all granted
</Directory>

DocumentRoot /var/www/html
DocumentRoot /var/www/html{DOCROOTSUB}

AccessFileName .htaccess
<FilesMatch "^\.ht">
Expand Down
3 changes: 2 additions & 1 deletion 7.3.2-apache/init_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/

sed -i "s/SSH_PORT/$SSH_PORT/g" /etc/ssh/sshd_config
service ssh start
sed -i "s/{PORT}/$PORT/g" /etc/apache2/apache2.conf
sed -i "s|{PORT}|$PORT|g" /etc/apache2/apache2.conf
sed -i "s|{DOCROOTSUB}|$DOCROOTSUB|g" /etc/apache2/apache2.conf
mkdir /var/lock/apache2
mkdir /var/run/apache2

Expand Down

0 comments on commit ddc3187

Please sign in to comment.