You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/12/12 16:28:51 UTC

[sling-org-apache-sling-app-cms] branch master updated: Create a separate folder for docker and make Dockerfile runnable (#2)

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to refs/heads/master by this push:
     new 263033a  Create a separate folder for docker and make Dockerfile runnable (#2)
263033a is described below

commit 263033ac340787b92fa4db6b065d0fe5470aaba1
Author: mahsumdemir <ma...@gmail.com>
AuthorDate: Wed Dec 12 19:28:46 2018 +0300

    Create a separate folder for docker and make Dockerfile runnable (#2)
    
    Thanks @mahsumdemir!
---
 {vagrant => docker}/Dockerfile |  5 +++-
 docker/cache_disk.conf         | 16 ++++++++++++
 docker/cms.conf                | 22 ++++++++++++++++
 docker/site.conf               | 58 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/vagrant/Dockerfile b/docker/Dockerfile
similarity index 86%
rename from vagrant/Dockerfile
rename to docker/Dockerfile
index 11cbdc3..86ca56a 100644
--- a/vagrant/Dockerfile
+++ b/docker/Dockerfile
@@ -22,7 +22,7 @@ VOLUME /opt/sling/sling
 
 # Setup Sling CMS
 RUN mkdir -p /opt/sling
-RUN wget https://repository.apache.org/content/repositories/snapshots/org/apache/sling/org.apache.sling.cms.builder/1.0.0-SNAPSHOT/org.apache.sling.cms.builder-1.0.0-20180512.031838-12.jar
+RUN wget -O org.apache.sling.cms.jar https://repository.apache.org/content/repositories/snapshots/org/apache/sling/org.apache.sling.cms.builder/0.11.3-SNAPSHOT/org.apache.sling.cms.builder-0.11.3-20181207.040617-10.jar
 ENV JAVA_OPTS -Xmx512m
 ENV SLING_OPTS ''
 
@@ -30,6 +30,9 @@ ENV SLING_OPTS ''
 RUN apt-get update 
 RUN apt-get install apache2 -y
 
+# Configure mod_rewrite
+RUN a2enmod rewrite
+
 # Configure mod_proxy
 RUN a2enmod proxy
 RUN a2enmod proxy_http
diff --git a/docker/cache_disk.conf b/docker/cache_disk.conf
new file mode 100644
index 0000000..1028b14
--- /dev/null
+++ b/docker/cache_disk.conf
@@ -0,0 +1,16 @@
+#
+#		 Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+#        agreements. See the NOTICE file distributed with this work for additional information
+#        regarding copyright ownership. The ASF licenses this file to you under the Apache License,
+#        Version 2.0 (the "License"); you may not use this file except in compliance with the
+#        License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+#        Unless required by applicable law or agreed to in writing, software distributed under the
+#        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#        either express or implied. See the License for the specific language governing permissions
+#        and limitations under the License.
+#
+
+<IfModule mod_cache_disk.c>
+    CacheDirLevels 2
+    CacheDirLength 1
+</IfModule>
\ No newline at end of file
diff --git a/docker/cms.conf b/docker/cms.conf
new file mode 100644
index 0000000..24d3be6
--- /dev/null
+++ b/docker/cms.conf
@@ -0,0 +1,22 @@
+#
+#		 Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+#        agreements. See the NOTICE file distributed with this work for additional information
+#        regarding copyright ownership. The ASF licenses this file to you under the Apache License,
+#        Version 2.0 (the "License"); you may not use this file except in compliance with the
+#        License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+#        Unless required by applicable law or agreed to in writing, software distributed under the
+#        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#        either express or implied. See the License for the specific language governing permissions
+#        and limitations under the License.
+#
+
+<VirtualHost *:80>
+   ServerName cms.sling.apache.org
+   DocumentRoot /var/www/vhosts/sling-cms
+   ErrorLog /var/log/apache2/sling-cms-err.log
+   TransferLog /var/log/apache2/sling-cms-access.log
+   
+   ProxyPass /.well-known !
+   ProxyPass / http://localhost:8080/
+   ProxyPassReverse / http://localhost:8080/
+</VirtualHost>
diff --git a/docker/site.conf b/docker/site.conf
new file mode 100644
index 0000000..7c595db
--- /dev/null
+++ b/docker/site.conf
@@ -0,0 +1,58 @@
+#
+#		 Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+#        agreements. See the NOTICE file distributed with this work for additional information
+#        regarding copyright ownership. The ASF licenses this file to you under the Apache License,
+#        Version 2.0 (the "License"); you may not use this file except in compliance with the
+#        License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+#        Unless required by applicable law or agreed to in writing, software distributed under the
+#        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#        either express or implied. See the License for the specific language governing permissions
+#        and limitations under the License.
+#
+
+<VirtualHost *:80>
+   ServerName sling2.apache.org
+   DocumentRoot /var/www/vhosts/sling
+   ErrorLog /var/log/apache2/sling-err.log
+   TransferLog /var/log/apache2/sling-access.log
+   
+   # Configure mod_cache
+   CacheEnable disk /
+   CacheIgnoreNoLastMod On
+   CacheRoot /var/cache/httpd/danklco-com
+   CacheDefaultExpire 600
+   
+   # Configure mod_expire
+   ExpiresActive On
+   ExpiresDefault "access plus 1 month"
+   ExpiresByType text/html "access plus 5 minutes"
+   ExpiresByType application/json "access plus 5 minutes"
+   ExpiresByType image/gif "access plus 1 year"
+   ExpiresByType image/jpeg "access plus 1 year"
+   ExpiresByType image/png "access plus 1 year"
+   ExpiresByType text/css "access plus 1 month"
+   ExpiresByType text/javascript "access plus 1 month"
+   ExpiresByType application/javascript "access plus 1 month"
+   
+   # Configure Proxy
+   ProxyPass /.well-known !
+   ProxyPass /ERROR !
+   ProxyPass /static/clientlibs/reference/ http://localhost:8080/static/clientlibs/reference/ connectiontimeout=10 timeout=60 retry=0
+   ProxyPassReverse /static/clientlibs/reference/ http://localhost:8080/static/clientlibs/reference/
+   ProxyPass / http://localhost:8080/content/apache/sling-apache-org/ connectiontimeout=10 timeout=60 retry=0
+   ProxyPassReverse /content/apache/sling-apache-org/ http://localhost:8080/content/apache/sling-apache-org/ 
+   
+   # Security / Hardening
+   AllowEncodedSlashes on
+   RewriteRule "^.+\..*\.json" - [F,L]
+   RewriteCond %{REQUEST_METHOD} ^(delete|post|trace|track) [NC]
+   RewriteRule .* - [F,L]
+   Header set X-Frame-Options SAMEORIGIN
+   Header set X-XSS-Protection "1; mode=block"
+   Header set X-Content-Type-Options "nosniff"
+
+   
+   # Compress text files
+   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
+   
+</VirtualHost>
\ No newline at end of file