Skip to content

Commit 78cb0a1

Browse files
committed
change persistent data folder, various note improvements
set ENV LISTEN_PORT
1 parent 6c6328c commit 78cb0a1

File tree

4 files changed

+30
-46
lines changed

4 files changed

+30
-46
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ RUN a2enmod userdir && a2enmod rewrite && a2enmod ssl && a2enmod expires
6464

6565
# Environment variables contained within build container.
6666
ENV TERM=xterm \
67+
LISTEN_PORT=80 \
6768
APACHE_RUN_USER=www-data \
6869
APACHE_RUN_GROUP=www-data \
6970
APACHE_LOG_DIR=/var/log/apache2 \
@@ -92,8 +93,10 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
9293
org.label-schema.version=$VERSION \
9394
org.label-schema.schema-version="1.0"
9495

95-
# Add VOLUMEs to allow backup of config and databases
96-
VOLUME ["/data"]
96+
# Add VOLUMEs for persistant data or to allow various
97+
# backups of config and databases via --volumes-from
98+
# http://bit.ly/autobuild-and-autodeploy
99+
VOLUME ["/backup"]
97100

98101
# Note that EXPOSE only works for inter-container links. It doesn't make ports
99102
# accessible from the host. To expose port(s) to the host, at runtime, use the -p flag.

app/apache-config.conf

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Group www-data
33
ServerName apache
44
ServerAdmin hosting@htmlgraphic.com
55

6+
<Directory /data/www/public_html>
7+
Options +FollowSymLinks +Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
8+
AllowOverride All
9+
Allow from all
10+
Require all granted
11+
</Directory>
12+
613
<VirtualHost *:80>
714
DocumentRoot /data/www/public_html
815
CustomLog /data/apache2/logs/access_log combined
@@ -20,30 +27,10 @@ ServerAdmin hosting@htmlgraphic.com
2027
SSLCertificateFile /data/apache2/ssl/ssl-cert-snakeoil.pem
2128
SSLCertificateKeyFile /data/apache2/ssl/ssl-cert-snakeoil.key
2229

23-
<FilesMatch "\.(cgi|shtml|phtml|php)$">
24-
SSLOptions +StdEnvVars
25-
</FilesMatch>
26-
<Directory /usr/lib/cgi-bin>
27-
SSLOptions +StdEnvVars
28-
</Directory>
29-
BrowserMatch "MSIE [2-6]" \
30-
nokeepalive ssl-unclean-shutdown \
31-
downgrade-1.0 force-response-1.0
32-
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
33-
3430
CustomLog /data/apache2/logs/access_log combined
3531
ErrorLog /data/apache2/logs/error_log
3632
</VirtualHost>
3733

38-
39-
<Directory /data/www/public_html>
40-
Options +FollowSymLinks +Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
41-
AllowOverride All
42-
Allow from all
43-
Require all granted
44-
</Directory>
45-
46-
4734
<FilesMatch "^\.ht">
4835
Order allow,deny
4936
Deny from all

app/index.php

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@
1919
word-wrap: break-word;
2020
}
2121
.h {
22-
background-color: #99c;
23-
font-weight: bold;
22+
background-color: #99c;
23+
font-weight: bold;
2424
}
2525
.center table {
26-
margin: 1em auto;
27-
text-align: left;
26+
margin: 1em auto;
27+
text-align: left;
2828
}
2929
table {
30-
border-collapse: collapse;
31-
border: 0;
32-
width: 934px;
30+
border-collapse: collapse;
31+
border: 0;
32+
width: 934px;
3333
}
3434
td, th {
35-
border: 1px solid #666;
36-
vertical-align: baseline;
37-
padding: 4px 5px;
35+
border: 1px solid #666;
36+
vertical-align: baseline;
37+
padding: 4px 5px;
3838
}
3939
img {
40-
float: right;
41-
border: 0;
40+
float: right;
41+
border: 0;
4242
}
4343
.h h1 {
44-
font-size: 150%;
44+
font-size: 150%;
4545
}
4646
</style>
4747

@@ -50,14 +50,7 @@
5050
$node_env = getenv('NODE_ENVIRONMENT');
5151
} else {
5252
$node_env = 'NOT SET';
53-
}
54-
55-
if (getenv('DOCKERCLOUD_SERVICE_FQDN')) {
56-
$hostname = getenv('DOCKERCLOUD_SERVICE_FQDN');
57-
} else {
58-
$hostname = getenv('HOSTNAME');
59-
}
60-
?>
53+
} ?>
6154
</head>
6255
<body>
6356
<?= "<!-- NODE_ENVIRONMENT=". getenv('NODE_ENVIRONMENT') ." -->"; ?>
@@ -74,7 +67,7 @@
7467
</tr>
7568
<tr>
7669
<td class="text-right">HOSTNAME</td>
77-
<td class="text-left"><?= $hostname ?></td>
70+
<td class="text-left"><?= getenv('HOSTNAME') ?></td>
7871
</tr>
7972
<?php if ($node_env == 'dev') { ?>
8073
<?php if (getenv('MYSQL_PORT')) {?>

tests/build_tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ testNODE_ENVIRONMENT()
7474
node_env=0;
7575

7676
# Depending on the type of environment dev or production an
77-
# environmental variable should be set
77+
# environment variable should be set
7878
if [[ ${NODE_ENVIRONMENT} == 'dev' ]] || [[ ${NODE_ENVIRONMENT} == 'production' ]]; then
7979
node_env=1;
8080
fi
@@ -87,11 +87,12 @@ testNODE_ENVIRONMENT_PHP()
8787
{
8888
echo 'Test env NODE_ENVIRONMENT within Apache'
8989
node_env=0;
90+
9091
dev=$(/usr/bin/wget -q -O- http://127.0.0.1 | grep -w "NODE_ENVIRONMENT=dev" | wc -l);
9192
prod=$(/usr/bin/wget -q -O- http://127.0.0.1 | grep -w "NODE_ENVIRONMENT=production" | wc -l)
9293

9394
# Depending on the type of environment dev or production an
94-
# environmental variable should be set
95+
# environment variable should be set
9596
if [[ $dev == 1 ]] || [[ $prod == 1 ]]; then
9697
node_env=1;
9798
fi

0 commit comments

Comments
 (0)