diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f81fa117..1067dbc15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. This project adheres to [WebDevOps.io Dockerfile](https://github.com/webdevops/Dockerfile). +## [1.1.0] - 2016-12-14 +- Fixed dnsmasq startup +- Removed all logfiles inside containers (using stdout) +- Fixed syslog-ng setup (was complaining about version) +- Fixed some php/hhvm tests +- Improve bin/console +- Add cleanup after container installation +- Add multiple vhost support for dns lookup (VIRTUAL_HOST) + ## [1.0.0] - 2016-11-28 - Introduced python based processing script - Introduced testinfra test suite diff --git a/bin/command/docker_build_command.py b/bin/command/docker_build_command.py index 8472564ef..0a0e08f99 100644 --- a/bin/command/docker_build_command.py +++ b/bin/command/docker_build_command.py @@ -28,6 +28,7 @@ class DockerBuildCommand(DoitCommand): Build images docker:build + {docker images?* : Docker images (whitelist)} {--dry-run : show only which images will be build} {--no-cache : build without caching} {--t|threads=0 : threads} diff --git a/bin/command/docker_exec_command.py b/bin/command/docker_exec_command.py new file mode 100644 index 000000000..d2cd34321 --- /dev/null +++ b/bin/command/docker_exec_command.py @@ -0,0 +1,93 @@ +#!/usr/bin/env/python +# -*- coding: utf-8 -*- +# +# (c) 2016 WebDevOps.io +# +# This file is part of Dockerfile Repository. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +# documentation files (the "Software"), to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +# to permit persons to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions +# of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +from cleo import Output +from termcolor import colored +from webdevops.command import DoitCommand +from webdevops.taskloader import DockerPushTaskLoader +from webdevops import Command, DockerfileUtility + +class DockerExecCommand(DoitCommand): + """ + Push images to registry/hub + + docker:exec + {docker command* : Command} + {--dry-run : show only which images will be build} + {--whitelist=?* : image/tag whitelist } + {--blacklist=?* : image/tag blacklist } + """ + + def run_task(self, configuration): + dockerfile_list = DockerfileUtility.find_dockerfiles_in_path( + base_path=configuration.get('dockerPath'), + path_regex=configuration.get('docker.pathRegex'), + image_prefix=configuration.get('docker.imagePrefix'), + whitelist=configuration.get('whitelist'), + blacklist=configuration.get('blacklist'), + ) + + image_fail_list = [] + + docker_command = self.argument('docker command') + + for dockerfile in dockerfile_list: + title = dockerfile['image']['fullname'] + + print title + print '~' * len(title) + + if configuration['dryRun']: + print ' exec: %s' % (docker_command) + else: + + cmd = [ + 'docker', + 'run', + '-t', + '--rm', + dockerfile['image']['fullname'], + 'sh -c "%s"' % (' '.join(docker_command)) + ] + + status = Command.execute(cmd) + + if status: + print colored(' -> successfull', 'green') + else: + print colored(' -> failed', 'red') + image_fail_list.append(dockerfile['image']['fullname']) + print '' + print '' + + if len(image_fail_list) >= 1: + print '' + print colored(' => failed images (%s):' % (str(len(image_fail_list))), 'red') + for image in image_fail_list: + print ' - %s ' % image + print '' + + return False + else: + return True + + + + diff --git a/bin/command/docker_pull_command.py b/bin/command/docker_pull_command.py index 9608b8477..e6f960b47 100644 --- a/bin/command/docker_pull_command.py +++ b/bin/command/docker_pull_command.py @@ -27,6 +27,7 @@ class DockerPullCommand(DoitCommand): Pull all built images from registry/hub docker:pull + {docker images?* : Docker images (whitelist)} {--dry-run : show only which images will be build} {--t|threads=0 : threads} {--r|retry=0 : retry} diff --git a/bin/command/docker_push_command.py b/bin/command/docker_push_command.py index 6f0f55daf..85912b5b7 100644 --- a/bin/command/docker_push_command.py +++ b/bin/command/docker_push_command.py @@ -27,6 +27,7 @@ class DockerPushCommand(DoitCommand): Push images to registry/hub docker:push + {docker images?* : Docker images (whitelist)} {--dry-run : show only which images will be build} {--t|threads=0 : threads} {--r|retry=0 : retry} diff --git a/bin/command/generate_dockerfile_command.py b/bin/command/generate_dockerfile_command.py index b5a27b22f..b5a3710d8 100644 --- a/bin/command/generate_dockerfile_command.py +++ b/bin/command/generate_dockerfile_command.py @@ -29,6 +29,7 @@ class GenerateDockerfileCommand(BaseCommand): Build Dockerfile containers generate:dockerfile + {docker images?* : Docker images (whitelist)} {--whitelist=?* : image/tag whitelist } {--blacklist=?* : image/tag blacklist } """ diff --git a/bin/command/test_serverspec_command.py b/bin/command/test_serverspec_command.py index 2cb878f20..69c5ac5ad 100644 --- a/bin/command/test_serverspec_command.py +++ b/bin/command/test_serverspec_command.py @@ -29,6 +29,7 @@ class TestServerspecCommand(DoitCommand): Test docker images with Serverspec test:serverspec + {docker images?* : Docker images (whitelist)} {--dry-run : show only which images will be build} {--t|threads=0 : threads} {--r|retry=0 : retry} diff --git a/bin/command/test_testinfra_command.py b/bin/command/test_testinfra_command.py index 2250cd675..39508bd45 100644 --- a/bin/command/test_testinfra_command.py +++ b/bin/command/test_testinfra_command.py @@ -27,6 +27,7 @@ class TestTestinfraCommand(DoitCommand): Test docker images with Testinfra test:testinfra + {docker images?* : Docker images (whitelist)} {--dry-run : show only which images will be build} {--t|threads=0 : threads} {--whitelist=?* : image/tag whitelist } diff --git a/bin/console b/bin/console index 2496589e1..fd13b7528 100755 --- a/bin/console +++ b/bin/console @@ -20,6 +20,7 @@ from webdevops.docker.DockerCliClient import DockerCliClient from command.docker_build_command import DockerBuildCommand from command.docker_push_command import DockerPushCommand from command.docker_pull_command import DockerPullCommand +from command.docker_exec_command import DockerExecCommand from command.test_testinfra_command import TestTestinfraCommand from command.test_serverspec_command import TestServerspecCommand from command.generate_dockerfile_command import GenerateDockerfileCommand @@ -88,6 +89,7 @@ if __name__ == '__main__': application.add(DockerBuildCommand(configuration=configuration)) application.add(DockerPushCommand(configuration=configuration)) application.add(DockerPullCommand(configuration=configuration)) + application.add(DockerExecCommand(configuration=configuration)) application.add(TestTestinfraCommand(configuration=configuration)) application.add(TestServerspecCommand(configuration=configuration)) application.add(GenerateDockerfileCommand(configuration=configuration)) diff --git a/bin/webdevops/DockerfileUtility.py b/bin/webdevops/DockerfileUtility.py index 23c3fa5cb..b1cccb404 100644 --- a/bin/webdevops/DockerfileUtility.py +++ b/bin/webdevops/DockerfileUtility.py @@ -53,8 +53,13 @@ def find_file_in_path(dockerfile_path, filename="Dockerfile", whitelist=False, b # filter by whitelist if whitelist: - for term in whitelist: - file_list = filter(lambda x: term in x, file_list) + tmp = [] + for file in file_list: + for term in whitelist: + if term in file: + tmp.append(file) + break + file_list = tmp if blacklist: for term in blacklist: @@ -108,12 +113,11 @@ def parse_docker_info_from_path(path): } ret.append(dockerfile) - if whitelist or blacklist: - ret = filter_dockerfile( - dockerfile_list=ret, - whitelist=whitelist, - blacklist = blacklist - ) + ret = filter_dockerfile( + dockerfile_list=ret, + whitelist=whitelist, + blacklist = blacklist + ) return ret @@ -123,8 +127,13 @@ def filter_dockerfile(dockerfile_list, whitelist=False, blacklist=False): Filter Dockerfiles by white- and blacklist """ if whitelist: - for term in whitelist: - dockerfile_list = filter(lambda x: term in x['image']['fullname'], dockerfile_list) + tmp = [] + for dockerfile in dockerfile_list: + for term in whitelist: + if term in dockerfile['image']['fullname']: + tmp.append(dockerfile) + break + dockerfile_list = tmp if blacklist: for term in blacklist: diff --git a/bin/webdevops/command/BaseCommand.py b/bin/webdevops/command/BaseCommand.py index 809618d61..f00b01c08 100644 --- a/bin/webdevops/command/BaseCommand.py +++ b/bin/webdevops/command/BaseCommand.py @@ -183,7 +183,17 @@ def get_whitelist(self): """ Get whitelist """ - return list(self.option('whitelist')) + + # add whitelist from --whitelist + ret = list(self.option('whitelist')) + + # add whitelist from argument list + try: + ret.extend(self.argument('docker images')) + except (Exception): + pass + + return ret def get_blacklist(self): """ @@ -211,13 +221,13 @@ def get_threads(self): # use configuration value threads = self.configuration.get('threads') - match = re.match('auto(([-*+/])([0-9]+))?', str(threads)) + match = re.match('auto(([-*+/])([0-9]+\.?[0-9]?))?', str(threads)) if match is not None: ret = multiprocessing.cpu_count() if match.group(2) and match.group(3): math_sign = match.group(2) - math_value = int(match.group(3)) + math_value = float(match.group(3)) if math_sign == "*": ret = int(ret * math_value) diff --git a/bin/webdevops/docker/DockerCliClient.py b/bin/webdevops/docker/DockerCliClient.py index 994245bae..2f59b5171 100644 --- a/bin/webdevops/docker/DockerCliClient.py +++ b/bin/webdevops/docker/DockerCliClient.py @@ -18,13 +18,10 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import subprocess -import os -import tempfile +import os, subprocess, tempfile from .DockerBaseClient import DockerBaseClient from webdevops import Command - class DockerCliClient(DockerBaseClient): def pull_image(self, name, tag): diff --git a/bin/webdevops/docker/DockerPyClient.py b/bin/webdevops/docker/DockerPyClient.py index 70b52cf54..507a190f0 100644 --- a/bin/webdevops/docker/DockerPyClient.py +++ b/bin/webdevops/docker/DockerPyClient.py @@ -18,7 +18,6 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - import os from .DockerBaseClient import DockerBaseClient diff --git a/bin/webdevops/doit/DoitReporter.py b/bin/webdevops/doit/DoitReporter.py index cbb14d85b..15f917b37 100644 --- a/bin/webdevops/doit/DoitReporter.py +++ b/bin/webdevops/doit/DoitReporter.py @@ -18,13 +18,10 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import sys -import os -import time -import datetime -import StringIO +import os, sys, time, datetime, StringIO import termcolor from termcolor import colored +from ..taskloader.BaseTaskLoader import BaseTaskLoader class TaskResult(object): """ @@ -141,7 +138,7 @@ def add_failure(self, task, exception): if task.actions and (task.name[0] != '_'): duration = self.duration(self.t_results[task.name].elapsed) - self.write(colored('. %s FAILED (%s)\n' % (task.title(), duration), 'red')) + self.writeln(colored('. %s FAILED (%s)' % (BaseTaskLoader.human_task_name(task.title()), duration), 'red')) self.failures.append({'task': task, 'exception': exception}) def add_success(self, task): @@ -152,7 +149,7 @@ def add_success(self, task): if task.actions and (task.name[0] != '_'): duration = self.duration(self.t_results[task.name].elapsed) - self.write(colored('. %s finished (%s)\n' % (task.title(), duration), 'green')) + self.writeln(colored('. %s finished (%s)' % (BaseTaskLoader.human_task_name(task.title()), duration), 'green')) def skip_uptodate(self, task): """ @@ -252,7 +249,7 @@ def task_stdout(self, title, duration=False, stdout=False, stderr=False, error=F if duration: text_duration = ' (%s)' % self.duration(duration) - title_full = 'Task %s%s:' % (title, text_duration) + title_full = 'Task %s%s:' % (BaseTaskLoader.human_task_name(title), text_duration) self.writeln(title_full) self.writeln('~' * len(title_full)) @@ -277,7 +274,7 @@ def task_stdout(self, title, duration=False, stdout=False, stderr=False, error=F self.write('%s' % exception.get_msg()) self.writeln() - self.writeln(':: end of output "%s"' % title) + self.writeln(':: end of output "%s"' % (BaseTaskLoader.human_task_name(title))) self.writeln() def duration(self, duration): diff --git a/bin/webdevops/taskloader/BaseDockerTaskLoader.py b/bin/webdevops/taskloader/BaseDockerTaskLoader.py index 7fae9ba89..969e399e4 100644 --- a/bin/webdevops/taskloader/BaseDockerTaskLoader.py +++ b/bin/webdevops/taskloader/BaseDockerTaskLoader.py @@ -18,10 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import os -import sys -import re -import copy +import os, sys, re, copy from .BaseTaskLoader import BaseTaskLoader from webdevops import DockerfileUtility from doit.task import dict_to_task diff --git a/bin/webdevops/taskloader/BaseTaskLoader.py b/bin/webdevops/taskloader/BaseTaskLoader.py index a51d18fd7..0d2b9c363 100644 --- a/bin/webdevops/taskloader/BaseTaskLoader.py +++ b/bin/webdevops/taskloader/BaseTaskLoader.py @@ -18,10 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import sys -import re -import time -import StringIO +import sys, re, time, StringIO from webdevops import DockerfileUtility from doit.cmd_base import TaskLoader from doit.task import dict_to_task @@ -44,6 +41,9 @@ def process_tasklist(self, tasklist): ret = [] for task in tasklist: ret.append(dict_to_task(task)) + + print 'Starting execution of %s tasks...' % (len(ret)) + return ret @@ -52,7 +52,12 @@ def human_task_name(name): """ Translate internal task name to human readable name """ - return re.search('^.*\|(.*)', name).group(1) + res = re.search('^.*\|(.*)', name) + + if res: + return re.search('^.*\|(.*)', name).group(1) + else: + return name @staticmethod diff --git a/bin/webdevops/taskloader/DockerBuildTaskLoader.py b/bin/webdevops/taskloader/DockerBuildTaskLoader.py index 43501140f..97eb6dffc 100644 --- a/bin/webdevops/taskloader/DockerBuildTaskLoader.py +++ b/bin/webdevops/taskloader/DockerBuildTaskLoader.py @@ -18,11 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import os -import sys -import re -import copy -import time +import os, sys, re, copy, time from .BaseTaskLoader import BaseTaskLoader from .BaseDockerTaskLoader import BaseDockerTaskLoader from webdevops import DockerfileUtility diff --git a/bin/webdevops/taskloader/DockerPullTaskLoader.py b/bin/webdevops/taskloader/DockerPullTaskLoader.py index be8a9c3a6..4bed18a51 100644 --- a/bin/webdevops/taskloader/DockerPullTaskLoader.py +++ b/bin/webdevops/taskloader/DockerPullTaskLoader.py @@ -18,10 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import os -import sys -import re -import copy +import os, sys, re, copy from .BaseTaskLoader import BaseTaskLoader from .BaseDockerTaskLoader import BaseDockerTaskLoader from webdevops import DockerfileUtility diff --git a/bin/webdevops/taskloader/DockerPushTaskLoader.py b/bin/webdevops/taskloader/DockerPushTaskLoader.py index 118c3927e..eaaf1c1ca 100644 --- a/bin/webdevops/taskloader/DockerPushTaskLoader.py +++ b/bin/webdevops/taskloader/DockerPushTaskLoader.py @@ -18,10 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import os -import sys -import re -import copy +import os, sys, re, copy from .BaseTaskLoader import BaseTaskLoader from .BaseDockerTaskLoader import BaseDockerTaskLoader from webdevops import DockerfileUtility diff --git a/bin/webdevops/taskloader/DockerTestTestinfraTaskLoader.py b/bin/webdevops/taskloader/DockerTestTestinfraTaskLoader.py index f4cc4f7cd..d0f1800e7 100644 --- a/bin/webdevops/taskloader/DockerTestTestinfraTaskLoader.py +++ b/bin/webdevops/taskloader/DockerTestTestinfraTaskLoader.py @@ -18,8 +18,7 @@ # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import os -import re +import os, re from .BaseDockerTaskLoader import BaseDockerTaskLoader from .BaseTaskLoader import BaseTaskLoader from webdevops.testinfra import TestinfraDockerPlugin diff --git a/conf/provision.yml b/conf/provision.yml index 7dbfcff9a..ca87d653f 100644 --- a/conf/provision.yml +++ b/conf/provision.yml @@ -29,7 +29,7 @@ provision: hhvm: configuration: hhvm/general : '*' - hhmv-apache: + hhvm-apache: configuration: apache/general : '*' hhvm-apache/general : '*' diff --git a/docker/ansible/alpine-3/Dockerfile b/docker/ansible/alpine-3/Dockerfile index 592fa61bf..bf719d7a6 100644 --- a/docker/ansible/alpine-3/Dockerfile +++ b/docker/ansible/alpine-3/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/centos-7/Dockerfile b/docker/ansible/centos-7/Dockerfile index fca21136d..b117e0e3d 100644 --- a/docker/ansible/centos-7/Dockerfile +++ b/docker/ansible/centos-7/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/debian-7/Dockerfile b/docker/ansible/debian-7/Dockerfile index 2f02d3983..59e2daa4e 100644 --- a/docker/ansible/debian-7/Dockerfile +++ b/docker/ansible/debian-7/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/debian-8/Dockerfile b/docker/ansible/debian-8/Dockerfile index 7bbb99527..f112ded30 100644 --- a/docker/ansible/debian-8/Dockerfile +++ b/docker/ansible/debian-8/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/debian-9/Dockerfile b/docker/ansible/debian-9/Dockerfile index 4436b123f..02392b565 100644 --- a/docker/ansible/debian-9/Dockerfile +++ b/docker/ansible/debian-9/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/ubuntu-12.04/Dockerfile b/docker/ansible/ubuntu-12.04/Dockerfile index a5ea31b55..07baa2617 100644 --- a/docker/ansible/ubuntu-12.04/Dockerfile +++ b/docker/ansible/ubuntu-12.04/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/ubuntu-14.04/Dockerfile b/docker/ansible/ubuntu-14.04/Dockerfile index 0116e6bb7..ed4ac25f6 100644 --- a/docker/ansible/ubuntu-14.04/Dockerfile +++ b/docker/ansible/ubuntu-14.04/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/ubuntu-15.04/Dockerfile b/docker/ansible/ubuntu-15.04/Dockerfile index ac2063cc0..a8a66a797 100644 --- a/docker/ansible/ubuntu-15.04/Dockerfile +++ b/docker/ansible/ubuntu-15.04/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/ubuntu-15.10/Dockerfile b/docker/ansible/ubuntu-15.10/Dockerfile index 851b86f5c..811c4bf6e 100644 --- a/docker/ansible/ubuntu-15.10/Dockerfile +++ b/docker/ansible/ubuntu-15.10/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/ansible/ubuntu-16.04/Dockerfile b/docker/ansible/ubuntu-16.04/Dockerfile index 6ac6c6c17..a205fb5e3 100644 --- a/docker/ansible/ubuntu-16.04/Dockerfile +++ b/docker/ansible/ubuntu-16.04/Dockerfile @@ -8,4 +8,4 @@ FROM webdevops/bootstrap:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 diff --git a/docker/apache-dev/alpine-3/Dockerfile b/docker/apache-dev/alpine-3/Dockerfile index 052cbdab9..65550d1b0 100644 --- a/docker/apache-dev/alpine-3/Dockerfile +++ b/docker/apache-dev/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/centos-7/Dockerfile b/docker/apache-dev/centos-7/Dockerfile index 50bcbebc9..e66549f47 100644 --- a/docker/apache-dev/centos-7/Dockerfile +++ b/docker/apache-dev/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/debian-7/Dockerfile b/docker/apache-dev/debian-7/Dockerfile index 2af74343d..69260e71e 100644 --- a/docker/apache-dev/debian-7/Dockerfile +++ b/docker/apache-dev/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/debian-8/Dockerfile b/docker/apache-dev/debian-8/Dockerfile index fac43e769..4000fc9df 100644 --- a/docker/apache-dev/debian-8/Dockerfile +++ b/docker/apache-dev/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/debian-9/Dockerfile b/docker/apache-dev/debian-9/Dockerfile index c6a8c4655..b0dfdde59 100644 --- a/docker/apache-dev/debian-9/Dockerfile +++ b/docker/apache-dev/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/ubuntu-12.04/Dockerfile b/docker/apache-dev/ubuntu-12.04/Dockerfile index ed5df91cf..93d95bfad 100644 --- a/docker/apache-dev/ubuntu-12.04/Dockerfile +++ b/docker/apache-dev/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/ubuntu-14.04/Dockerfile b/docker/apache-dev/ubuntu-14.04/Dockerfile index 97714504f..e6d5f8c3c 100644 --- a/docker/apache-dev/ubuntu-14.04/Dockerfile +++ b/docker/apache-dev/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/ubuntu-15.04/Dockerfile b/docker/apache-dev/ubuntu-15.04/Dockerfile index f6d7a0d4e..fd82b777e 100644 --- a/docker/apache-dev/ubuntu-15.04/Dockerfile +++ b/docker/apache-dev/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/ubuntu-15.10/Dockerfile b/docker/apache-dev/ubuntu-15.10/Dockerfile index 7b302124d..19f8b74fa 100644 --- a/docker/apache-dev/ubuntu-15.10/Dockerfile +++ b/docker/apache-dev/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache-dev/ubuntu-16.04/Dockerfile b/docker/apache-dev/ubuntu-16.04/Dockerfile index 544690ecf..0ebc57186 100644 --- a/docker/apache-dev/ubuntu-16.04/Dockerfile +++ b/docker/apache-dev/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/apache:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/alpine-3/Dockerfile b/docker/apache/alpine-3/Dockerfile index 293acdad6..7ac087878 100644 --- a/docker/apache/alpine-3/Dockerfile +++ b/docker/apache/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/centos-7/Dockerfile b/docker/apache/centos-7/Dockerfile index a519633a9..e1cb902fd 100644 --- a/docker/apache/centos-7/Dockerfile +++ b/docker/apache/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/debian-7/Dockerfile b/docker/apache/debian-7/Dockerfile index 1abbea955..3601f6e3a 100644 --- a/docker/apache/debian-7/Dockerfile +++ b/docker/apache/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/debian-8/Dockerfile b/docker/apache/debian-8/Dockerfile index fabf8b7ea..dc0287a7c 100644 --- a/docker/apache/debian-8/Dockerfile +++ b/docker/apache/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/debian-9/Dockerfile b/docker/apache/debian-9/Dockerfile index 185ac96e9..16009a47a 100644 --- a/docker/apache/debian-9/Dockerfile +++ b/docker/apache/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/ubuntu-12.04/Dockerfile b/docker/apache/ubuntu-12.04/Dockerfile index 14ed88007..79dc55e12 100644 --- a/docker/apache/ubuntu-12.04/Dockerfile +++ b/docker/apache/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/ubuntu-14.04/Dockerfile b/docker/apache/ubuntu-14.04/Dockerfile index 39a5a3a4d..306b77e51 100644 --- a/docker/apache/ubuntu-14.04/Dockerfile +++ b/docker/apache/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/ubuntu-15.04/Dockerfile b/docker/apache/ubuntu-15.04/Dockerfile index 30c64f48a..61262f6a2 100644 --- a/docker/apache/ubuntu-15.04/Dockerfile +++ b/docker/apache/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/ubuntu-15.10/Dockerfile b/docker/apache/ubuntu-15.10/Dockerfile index 41d9c4c8a..8e18b99cf 100644 --- a/docker/apache/ubuntu-15.10/Dockerfile +++ b/docker/apache/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/apache/ubuntu-16.04/Dockerfile b/docker/apache/ubuntu-16.04/Dockerfile index ce5a085ed..6f30c5c92 100644 --- a/docker/apache/ubuntu-16.04/Dockerfile +++ b/docker/apache/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/base-app/alpine-3/Dockerfile b/docker/base-app/alpine-3/Dockerfile index 5bde2b016..6cdf20d64 100644 --- a/docker/base-app/alpine-3/Dockerfile +++ b/docker/base-app/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/alpine-3/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/alpine-3/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/alpine-3/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/alpine-3/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/alpine-3/conf/etc/supervisor.d/postfix.conf b/docker/base-app/alpine-3/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/alpine-3/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/alpine-3/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/centos-7/Dockerfile b/docker/base-app/centos-7/Dockerfile index 9a9054ea0..454814ad4 100644 --- a/docker/base-app/centos-7/Dockerfile +++ b/docker/base-app/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/centos-7/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/centos-7/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/centos-7/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/centos-7/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/centos-7/conf/etc/supervisor.d/postfix.conf b/docker/base-app/centos-7/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/centos-7/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/centos-7/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/debian-7/Dockerfile b/docker/base-app/debian-7/Dockerfile index b61e87492..59d0fd21b 100644 --- a/docker/base-app/debian-7/Dockerfile +++ b/docker/base-app/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/debian-7/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/debian-7/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/debian-7/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/debian-7/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/debian-7/conf/etc/supervisor.d/postfix.conf b/docker/base-app/debian-7/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/debian-7/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/debian-7/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/debian-8/Dockerfile b/docker/base-app/debian-8/Dockerfile index 7ece0b0d3..d3f754564 100644 --- a/docker/base-app/debian-8/Dockerfile +++ b/docker/base-app/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/debian-8/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/debian-8/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/debian-8/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/debian-8/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/debian-8/conf/etc/supervisor.d/postfix.conf b/docker/base-app/debian-8/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/debian-8/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/debian-8/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/debian-9/Dockerfile b/docker/base-app/debian-9/Dockerfile index e63595f62..72de6e9d3 100644 --- a/docker/base-app/debian-9/Dockerfile +++ b/docker/base-app/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/debian-9/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/debian-9/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/debian-9/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/debian-9/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/debian-9/conf/etc/supervisor.d/postfix.conf b/docker/base-app/debian-9/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/debian-9/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/debian-9/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/ubuntu-12.04/Dockerfile b/docker/base-app/ubuntu-12.04/Dockerfile index 7811f6f33..5e42ccc3a 100644 --- a/docker/base-app/ubuntu-12.04/Dockerfile +++ b/docker/base-app/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/ubuntu-12.04/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/ubuntu-12.04/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/ubuntu-12.04/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/ubuntu-12.04/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/ubuntu-12.04/conf/etc/supervisor.d/postfix.conf b/docker/base-app/ubuntu-12.04/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/ubuntu-12.04/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/ubuntu-12.04/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/ubuntu-14.04/Dockerfile b/docker/base-app/ubuntu-14.04/Dockerfile index dcb9cff1c..73c1ba2d3 100644 --- a/docker/base-app/ubuntu-14.04/Dockerfile +++ b/docker/base-app/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/ubuntu-14.04/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/ubuntu-14.04/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/ubuntu-14.04/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/ubuntu-14.04/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/ubuntu-14.04/conf/etc/supervisor.d/postfix.conf b/docker/base-app/ubuntu-14.04/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/ubuntu-14.04/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/ubuntu-14.04/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/ubuntu-15.04/Dockerfile b/docker/base-app/ubuntu-15.04/Dockerfile index e8de16740..4af40ca6d 100644 --- a/docker/base-app/ubuntu-15.04/Dockerfile +++ b/docker/base-app/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/ubuntu-15.04/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/ubuntu-15.04/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/ubuntu-15.04/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/ubuntu-15.04/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/ubuntu-15.04/conf/etc/supervisor.d/postfix.conf b/docker/base-app/ubuntu-15.04/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/ubuntu-15.04/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/ubuntu-15.04/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/ubuntu-15.10/Dockerfile b/docker/base-app/ubuntu-15.10/Dockerfile index c8f25130b..55d9c647d 100644 --- a/docker/base-app/ubuntu-15.10/Dockerfile +++ b/docker/base-app/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/ubuntu-15.10/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/ubuntu-15.10/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/ubuntu-15.10/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/ubuntu-15.10/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/ubuntu-15.10/conf/etc/supervisor.d/postfix.conf b/docker/base-app/ubuntu-15.10/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/ubuntu-15.10/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/ubuntu-15.10/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base-app/ubuntu-16.04/Dockerfile b/docker/base-app/ubuntu-16.04/Dockerfile index 2f18d2316..c9b528626 100644 --- a/docker/base-app/ubuntu-16.04/Dockerfile +++ b/docker/base-app/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV APPLICATION_USER application ENV APPLICATION_GROUP application diff --git a/docker/base-app/ubuntu-16.04/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/base-app/ubuntu-16.04/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/base-app/ubuntu-16.04/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/base-app/ubuntu-16.04/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/base-app/ubuntu-16.04/conf/etc/supervisor.d/postfix.conf b/docker/base-app/ubuntu-16.04/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/base-app/ubuntu-16.04/conf/etc/supervisor.d/postfix.conf +++ b/docker/base-app/ubuntu-16.04/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/base/alpine-3/Dockerfile b/docker/base/alpine-3/Dockerfile index cee04ed06..70dea1d30 100644 --- a/docker/base/alpine-3/Dockerfile +++ b/docker/base/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/alpine-3/conf/bin/config.sh b/docker/base/alpine-3/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/alpine-3/conf/bin/config.sh +++ b/docker/base/alpine-3/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/alpine-3/conf/bin/entrypoint.sh b/docker/base/alpine-3/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/alpine-3/conf/bin/entrypoint.sh +++ b/docker/base/alpine-3/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/alpine-3/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/alpine-3/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/alpine-3/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/alpine-3/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/alpine-3/conf/bin/service.d/syslog-ng.sh b/docker/base/alpine-3/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/alpine-3/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/alpine-3/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/alpine-3/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/alpine-3/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/alpine-3/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/alpine-3/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/alpine-3/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/alpine-3/conf/etc/syslog-ng/syslog-ng.conf index 0f1638471..adda3e8c5 100644 --- a/docker/base/alpine-3/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/alpine-3/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ -@version: 3.7 +@version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/alpine-3/conf/provision/build.d/10-cleanup.sh b/docker/base/alpine-3/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/alpine-3/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/alpine-3/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/centos-7/Dockerfile b/docker/base/centos-7/Dockerfile index 5cd403c2c..1012bb5a5 100644 --- a/docker/base/centos-7/Dockerfile +++ b/docker/base/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/centos-7/conf/bin/config.sh b/docker/base/centos-7/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/centos-7/conf/bin/config.sh +++ b/docker/base/centos-7/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/centos-7/conf/bin/entrypoint.sh b/docker/base/centos-7/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/centos-7/conf/bin/entrypoint.sh +++ b/docker/base/centos-7/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/centos-7/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/centos-7/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/centos-7/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/centos-7/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/centos-7/conf/bin/service.d/syslog-ng.sh b/docker/base/centos-7/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/centos-7/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/centos-7/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/centos-7/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/centos-7/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/centos-7/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/centos-7/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/centos-7/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/centos-7/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/centos-7/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/centos-7/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/centos-7/conf/provision/build.d/10-cleanup.sh b/docker/base/centos-7/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/centos-7/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/centos-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/debian-7/Dockerfile b/docker/base/debian-7/Dockerfile index a6490ceb9..ff213c726 100644 --- a/docker/base/debian-7/Dockerfile +++ b/docker/base/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/debian-7/conf/bin/config.sh b/docker/base/debian-7/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/debian-7/conf/bin/config.sh +++ b/docker/base/debian-7/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/debian-7/conf/bin/entrypoint.sh b/docker/base/debian-7/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/debian-7/conf/bin/entrypoint.sh +++ b/docker/base/debian-7/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/debian-7/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/debian-7/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/debian-7/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/debian-7/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/debian-7/conf/bin/service.d/syslog-ng.sh b/docker/base/debian-7/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/debian-7/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/debian-7/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/debian-7/conf/etc/supervisor.conf b/docker/base/debian-7/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/debian-7/conf/etc/supervisor.conf +++ b/docker/base/debian-7/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/debian-7/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/debian-7/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/debian-7/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/debian-7/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/debian-7/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/debian-7/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/debian-7/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/debian-7/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/debian-7/conf/provision/build.d/10-cleanup.sh b/docker/base/debian-7/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/debian-7/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/debian-7/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/debian-8/Dockerfile b/docker/base/debian-8/Dockerfile index a5eab9e50..5c6958ac6 100644 --- a/docker/base/debian-8/Dockerfile +++ b/docker/base/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/debian-8/conf/bin/config.sh b/docker/base/debian-8/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/debian-8/conf/bin/config.sh +++ b/docker/base/debian-8/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/debian-8/conf/bin/entrypoint.sh b/docker/base/debian-8/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/debian-8/conf/bin/entrypoint.sh +++ b/docker/base/debian-8/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/debian-8/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/debian-8/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/debian-8/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/debian-8/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/debian-8/conf/bin/service.d/syslog-ng.sh b/docker/base/debian-8/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/debian-8/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/debian-8/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/debian-8/conf/etc/supervisor.conf b/docker/base/debian-8/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/debian-8/conf/etc/supervisor.conf +++ b/docker/base/debian-8/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/debian-8/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/debian-8/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/debian-8/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/debian-8/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/debian-8/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/debian-8/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/debian-8/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/debian-8/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/debian-8/conf/provision/build.d/10-cleanup.sh b/docker/base/debian-8/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/debian-8/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/debian-8/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/debian-9/Dockerfile b/docker/base/debian-9/Dockerfile index 9276e3df6..56e2c2e2c 100644 --- a/docker/base/debian-9/Dockerfile +++ b/docker/base/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/debian-9/conf/bin/config.sh b/docker/base/debian-9/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/debian-9/conf/bin/config.sh +++ b/docker/base/debian-9/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/debian-9/conf/bin/entrypoint.sh b/docker/base/debian-9/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/debian-9/conf/bin/entrypoint.sh +++ b/docker/base/debian-9/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/debian-9/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/debian-9/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/debian-9/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/debian-9/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/debian-9/conf/bin/service.d/syslog-ng.sh b/docker/base/debian-9/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/debian-9/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/debian-9/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/debian-9/conf/etc/supervisor.conf b/docker/base/debian-9/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/debian-9/conf/etc/supervisor.conf +++ b/docker/base/debian-9/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/debian-9/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/debian-9/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/debian-9/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/debian-9/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/debian-9/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/debian-9/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/debian-9/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/debian-9/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/debian-9/conf/provision/build.d/10-cleanup.sh b/docker/base/debian-9/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/debian-9/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/debian-9/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/ubuntu-12.04/Dockerfile b/docker/base/ubuntu-12.04/Dockerfile index a7648266e..647187827 100644 --- a/docker/base/ubuntu-12.04/Dockerfile +++ b/docker/base/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/ubuntu-12.04/conf/bin/config.sh b/docker/base/ubuntu-12.04/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/ubuntu-12.04/conf/bin/config.sh +++ b/docker/base/ubuntu-12.04/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/ubuntu-12.04/conf/bin/entrypoint.sh b/docker/base/ubuntu-12.04/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/ubuntu-12.04/conf/bin/entrypoint.sh +++ b/docker/base/ubuntu-12.04/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/ubuntu-12.04/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/ubuntu-12.04/conf/etc/supervisor.conf b/docker/base/ubuntu-12.04/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/ubuntu-12.04/conf/etc/supervisor.conf +++ b/docker/base/ubuntu-12.04/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/ubuntu-12.04/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/ubuntu-12.04/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/ubuntu-12.04/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/ubuntu-12.04/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-12.04/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-12.04/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/ubuntu-12.04/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/ubuntu-12.04/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/ubuntu-12.04/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-12.04/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/ubuntu-12.04/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/ubuntu-12.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/ubuntu-14.04/Dockerfile b/docker/base/ubuntu-14.04/Dockerfile index 0577d5d46..5ef921946 100644 --- a/docker/base/ubuntu-14.04/Dockerfile +++ b/docker/base/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/ubuntu-14.04/conf/bin/config.sh b/docker/base/ubuntu-14.04/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/ubuntu-14.04/conf/bin/config.sh +++ b/docker/base/ubuntu-14.04/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/ubuntu-14.04/conf/bin/entrypoint.sh b/docker/base/ubuntu-14.04/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/ubuntu-14.04/conf/bin/entrypoint.sh +++ b/docker/base/ubuntu-14.04/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/ubuntu-14.04/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/ubuntu-14.04/conf/etc/supervisor.conf b/docker/base/ubuntu-14.04/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/ubuntu-14.04/conf/etc/supervisor.conf +++ b/docker/base/ubuntu-14.04/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/ubuntu-14.04/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/ubuntu-14.04/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/ubuntu-14.04/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/ubuntu-14.04/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-14.04/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-14.04/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/ubuntu-14.04/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/ubuntu-14.04/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/ubuntu-14.04/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-14.04/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/ubuntu-14.04/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/ubuntu-14.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/ubuntu-15.04/Dockerfile b/docker/base/ubuntu-15.04/Dockerfile index 4c2d910f8..8b5e90ae9 100644 --- a/docker/base/ubuntu-15.04/Dockerfile +++ b/docker/base/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/ubuntu-15.04/conf/bin/config.sh b/docker/base/ubuntu-15.04/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/ubuntu-15.04/conf/bin/config.sh +++ b/docker/base/ubuntu-15.04/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/ubuntu-15.04/conf/bin/entrypoint.sh b/docker/base/ubuntu-15.04/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/ubuntu-15.04/conf/bin/entrypoint.sh +++ b/docker/base/ubuntu-15.04/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/ubuntu-15.04/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/ubuntu-15.04/conf/etc/supervisor.conf b/docker/base/ubuntu-15.04/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/ubuntu-15.04/conf/etc/supervisor.conf +++ b/docker/base/ubuntu-15.04/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/ubuntu-15.04/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/ubuntu-15.04/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/ubuntu-15.04/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/ubuntu-15.04/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-15.04/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-15.04/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/ubuntu-15.04/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/ubuntu-15.04/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/ubuntu-15.04/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-15.04/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/ubuntu-15.04/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/ubuntu-15.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/ubuntu-15.10/Dockerfile b/docker/base/ubuntu-15.10/Dockerfile index c6cd96d35..b935dd747 100644 --- a/docker/base/ubuntu-15.10/Dockerfile +++ b/docker/base/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/ubuntu-15.10/conf/bin/config.sh b/docker/base/ubuntu-15.10/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/ubuntu-15.10/conf/bin/config.sh +++ b/docker/base/ubuntu-15.10/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/ubuntu-15.10/conf/bin/entrypoint.sh b/docker/base/ubuntu-15.10/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/ubuntu-15.10/conf/bin/entrypoint.sh +++ b/docker/base/ubuntu-15.10/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/ubuntu-15.10/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/ubuntu-15.10/conf/etc/supervisor.conf b/docker/base/ubuntu-15.10/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/ubuntu-15.10/conf/etc/supervisor.conf +++ b/docker/base/ubuntu-15.10/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/ubuntu-15.10/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/ubuntu-15.10/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/ubuntu-15.10/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/ubuntu-15.10/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-15.10/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-15.10/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/ubuntu-15.10/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/ubuntu-15.10/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/ubuntu-15.10/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-15.10/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/ubuntu-15.10/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/ubuntu-15.10/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/base/ubuntu-16.04/Dockerfile b/docker/base/ubuntu-16.04/Dockerfile index 12e5556ec..9af4b835d 100644 --- a/docker/base/ubuntu-16.04/Dockerfile +++ b/docker/base/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV DOCKER_CONF_HOME /opt/docker/ diff --git a/docker/base/ubuntu-16.04/conf/bin/config.sh b/docker/base/ubuntu-16.04/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/base/ubuntu-16.04/conf/bin/config.sh +++ b/docker/base/ubuntu-16.04/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/base/ubuntu-16.04/conf/bin/entrypoint.sh b/docker/base/ubuntu-16.04/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/base/ubuntu-16.04/conf/bin/entrypoint.sh +++ b/docker/base/ubuntu-16.04/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.sh b/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.sh +++ b/docker/base/ubuntu-16.04/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/base/ubuntu-16.04/conf/etc/supervisor.conf b/docker/base/ubuntu-16.04/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/base/ubuntu-16.04/conf/etc/supervisor.conf +++ b/docker/base/ubuntu-16.04/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/base/ubuntu-16.04/conf/etc/supervisor.d/syslog-ng.conf b/docker/base/ubuntu-16.04/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/base/ubuntu-16.04/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/base/ubuntu-16.04/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/base/ubuntu-16.04/conf/etc/syslog-ng/syslog-ng.conf b/docker/base/ubuntu-16.04/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/base/ubuntu-16.04/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/base/ubuntu-16.04/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/base/ubuntu-16.04/conf/provision/build.d/10-cleanup.sh b/docker/base/ubuntu-16.04/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/base/ubuntu-16.04/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/base/ubuntu-16.04/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/bootstrap/alpine-3/Dockerfile b/docker/bootstrap/alpine-3/Dockerfile index a4fda92e7..4aa0933eb 100644 --- a/docker/bootstrap/alpine-3/Dockerfile +++ b/docker/bootstrap/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM alpine:3.4 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -49,4 +49,5 @@ RUN set -x \ && pip install ansible \ && chmod 750 /usr/bin/ansible* \ # Cleanup - && apk del python-dev + && apk del python-dev \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/centos-7/Dockerfile b/docker/bootstrap/centos-7/Dockerfile index 574de5cec..7fccb14ed 100644 --- a/docker/bootstrap/centos-7/Dockerfile +++ b/docker/bootstrap/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM centos:7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -41,4 +41,5 @@ RUN set -x \ && pip install ansible \ && chmod 750 /usr/bin/ansible* \ && yum erase -y python-devel \ - && yum clean all + && yum clean all \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/debian-7/Dockerfile b/docker/bootstrap/debian-7/Dockerfile index 7e732c123..2caf066e9 100644 --- a/docker/bootstrap/debian-7/Dockerfile +++ b/docker/bootstrap/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM debian:7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -56,4 +56,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/debian-8/Dockerfile b/docker/bootstrap/debian-8/Dockerfile index 955dcbb9c..ba73683e1 100644 --- a/docker/bootstrap/debian-8/Dockerfile +++ b/docker/bootstrap/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM debian:8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -56,4 +56,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/debian-9/Dockerfile b/docker/bootstrap/debian-9/Dockerfile index 4f491c805..76efc1b34 100644 --- a/docker/bootstrap/debian-9/Dockerfile +++ b/docker/bootstrap/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM debian:stretch MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -56,4 +56,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/ubuntu-12.04/Dockerfile b/docker/bootstrap/ubuntu-12.04/Dockerfile index 5452a1c99..6ccfbb641 100644 --- a/docker/bootstrap/ubuntu-12.04/Dockerfile +++ b/docker/bootstrap/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -57,4 +57,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/ubuntu-14.04/Dockerfile b/docker/bootstrap/ubuntu-14.04/Dockerfile index 51a5585a7..7d37b174e 100644 --- a/docker/bootstrap/ubuntu-14.04/Dockerfile +++ b/docker/bootstrap/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -55,4 +55,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/ubuntu-15.04/Dockerfile b/docker/bootstrap/ubuntu-15.04/Dockerfile index 8bb68ed83..c22c518a2 100644 --- a/docker/bootstrap/ubuntu-15.04/Dockerfile +++ b/docker/bootstrap/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -55,4 +55,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/ubuntu-15.10/Dockerfile b/docker/bootstrap/ubuntu-15.10/Dockerfile index e1707d68d..50c92d9e2 100644 --- a/docker/bootstrap/ubuntu-15.10/Dockerfile +++ b/docker/bootstrap/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -55,4 +55,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/bootstrap/ubuntu-16.04/Dockerfile b/docker/bootstrap/ubuntu-16.04/Dockerfile index c76e616a5..bcc9c64a4 100644 --- a/docker/bootstrap/ubuntu-16.04/Dockerfile +++ b/docker/bootstrap/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 # Ensure UTF-8 ENV LANG en_US.UTF-8 @@ -55,4 +55,5 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete diff --git a/docker/certbot/latest/Dockerfile b/docker/certbot/latest/Dockerfile index a6e802410..27e249b93 100644 --- a/docker/certbot/latest/Dockerfile +++ b/docker/certbot/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 VOLUME /etc/letsencrypt VOLUME /var/www diff --git a/docker/hhvm-apache/ubuntu-14.04/Dockerfile b/docker/hhvm-apache/ubuntu-14.04/Dockerfile index f811bb81b..a960e9313 100644 --- a/docker/hhvm-apache/ubuntu-14.04/Dockerfile +++ b/docker/hhvm-apache/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/hhvm:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/hhvm-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/hhvm-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/hhvm-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/hhvm-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/hhvm-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/hhvm-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/hhvm-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/hhvm-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/hhvm-apache/ubuntu-16.04/Dockerfile b/docker/hhvm-apache/ubuntu-16.04/Dockerfile index 87fdf0506..1cf6ab784 100644 --- a/docker/hhvm-apache/ubuntu-16.04/Dockerfile +++ b/docker/hhvm-apache/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/hhvm:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/hhvm-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/hhvm-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/hhvm-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/hhvm-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/hhvm-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/hhvm-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/hhvm-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/hhvm-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/hhvm-nginx/ubuntu-14.04/Dockerfile b/docker/hhvm-nginx/ubuntu-14.04/Dockerfile index 902196eea..0a86f028d 100644 --- a/docker/hhvm-nginx/ubuntu-14.04/Dockerfile +++ b/docker/hhvm-nginx/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/hhvm:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/hhvm-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/hhvm-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/hhvm-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/hhvm-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/hhvm-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf b/docker/hhvm-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/hhvm-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf +++ b/docker/hhvm-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/hhvm-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/hhvm-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/hhvm-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/hhvm-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/hhvm-nginx/ubuntu-16.04/Dockerfile b/docker/hhvm-nginx/ubuntu-16.04/Dockerfile index e05d99e35..8b9ed1831 100644 --- a/docker/hhvm-nginx/ubuntu-16.04/Dockerfile +++ b/docker/hhvm-nginx/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/hhvm:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/hhvm-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/hhvm-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/hhvm-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/hhvm-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/hhvm-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf b/docker/hhvm-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/hhvm-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf +++ b/docker/hhvm-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/hhvm-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/hhvm-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/hhvm-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/hhvm-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/hhvm/ubuntu-14.04/Dockerfile b/docker/hhvm/ubuntu-14.04/Dockerfile index c5af47c55..4e4dc2292 100644 --- a/docker/hhvm/ubuntu-14.04/Dockerfile +++ b/docker/hhvm/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/hhvm/ubuntu-16.04/Dockerfile b/docker/hhvm/ubuntu-16.04/Dockerfile index dda37d6a8..cb00ea929 100644 --- a/docker/hhvm/ubuntu-16.04/Dockerfile +++ b/docker/hhvm/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/liquibase/latest/Dockerfile b/docker/liquibase/latest/Dockerfile index 7e4a0830e..d4869fc95 100644 --- a/docker/liquibase/latest/Dockerfile +++ b/docker/liquibase/latest/Dockerfile @@ -8,7 +8,7 @@ FROM java:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV LIQUIBASE_VERSION "3.5.3" ENV LIQUIBASE_DRIVER "com.mysql.jdbc.Driver" diff --git a/docker/liquibase/mysql/Dockerfile b/docker/liquibase/mysql/Dockerfile index 045451c4a..1fda0b8fb 100644 --- a/docker/liquibase/mysql/Dockerfile +++ b/docker/liquibase/mysql/Dockerfile @@ -8,7 +8,7 @@ FROM java:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV LIQUIBASE_VERSION "3.5.3" ENV LIQUIBASE_DRIVER "com.mysql.jdbc.Driver" diff --git a/docker/liquibase/postgres/Dockerfile b/docker/liquibase/postgres/Dockerfile index 5732cf9cc..7a8c1c173 100644 --- a/docker/liquibase/postgres/Dockerfile +++ b/docker/liquibase/postgres/Dockerfile @@ -8,7 +8,7 @@ FROM java:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV LIQUIBASE_VERSION "3.5.3" ENV LIQUIBASE_DRIVER "org.postgresql.Driver" diff --git a/docker/mail-sandbox/latest/Dockerfile b/docker/mail-sandbox/latest/Dockerfile index 4056f3994..e496083bf 100644 --- a/docker/mail-sandbox/latest/Dockerfile +++ b/docker/mail-sandbox/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-nginx:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV MAILBOX_USERNAME "dev" ENV MAILBOX_PASSWORD "dev" diff --git a/docker/nginx-dev/alpine-3/Dockerfile b/docker/nginx-dev/alpine-3/Dockerfile index b8a2a99f8..630fb16bf 100644 --- a/docker/nginx-dev/alpine-3/Dockerfile +++ b/docker/nginx-dev/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/centos-7/Dockerfile b/docker/nginx-dev/centos-7/Dockerfile index bbf2aae4e..4455bbe66 100644 --- a/docker/nginx-dev/centos-7/Dockerfile +++ b/docker/nginx-dev/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/debian-7/Dockerfile b/docker/nginx-dev/debian-7/Dockerfile index 0064acd60..3b877f793 100644 --- a/docker/nginx-dev/debian-7/Dockerfile +++ b/docker/nginx-dev/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/debian-8/Dockerfile b/docker/nginx-dev/debian-8/Dockerfile index 5a41da675..3f23ea277 100644 --- a/docker/nginx-dev/debian-8/Dockerfile +++ b/docker/nginx-dev/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/debian-9/Dockerfile b/docker/nginx-dev/debian-9/Dockerfile index 74bf14d1d..932d63b61 100644 --- a/docker/nginx-dev/debian-9/Dockerfile +++ b/docker/nginx-dev/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/ubuntu-12.04/Dockerfile b/docker/nginx-dev/ubuntu-12.04/Dockerfile index 983cb6c1f..cb4d34353 100644 --- a/docker/nginx-dev/ubuntu-12.04/Dockerfile +++ b/docker/nginx-dev/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/ubuntu-14.04/Dockerfile b/docker/nginx-dev/ubuntu-14.04/Dockerfile index bbbf5e5d7..0c453465e 100644 --- a/docker/nginx-dev/ubuntu-14.04/Dockerfile +++ b/docker/nginx-dev/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/ubuntu-15.04/Dockerfile b/docker/nginx-dev/ubuntu-15.04/Dockerfile index ef9d83e15..3750ef0c3 100644 --- a/docker/nginx-dev/ubuntu-15.04/Dockerfile +++ b/docker/nginx-dev/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/ubuntu-15.10/Dockerfile b/docker/nginx-dev/ubuntu-15.10/Dockerfile index 7dc756390..c39ce5ed1 100644 --- a/docker/nginx-dev/ubuntu-15.10/Dockerfile +++ b/docker/nginx-dev/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx-dev/ubuntu-16.04/Dockerfile b/docker/nginx-dev/ubuntu-16.04/Dockerfile index 90b7d95c3..807d79642 100644 --- a/docker/nginx-dev/ubuntu-16.04/Dockerfile +++ b/docker/nginx-dev/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/nginx:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/alpine-3/Dockerfile b/docker/nginx/alpine-3/Dockerfile index 516cf6aac..472e6ef3d 100644 --- a/docker/nginx/alpine-3/Dockerfile +++ b/docker/nginx/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/alpine-3/conf/etc/nginx/nginx.conf b/docker/nginx/alpine-3/conf/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/docker/nginx/alpine-3/conf/etc/nginx/nginx.conf +++ b/docker/nginx/alpine-3/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/nginx/alpine-3/conf/etc/nginx/vhost.conf b/docker/nginx/alpine-3/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/alpine-3/conf/etc/nginx/vhost.conf +++ b/docker/nginx/alpine-3/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/centos-7/Dockerfile b/docker/nginx/centos-7/Dockerfile index c05dbaf1f..612c560ba 100644 --- a/docker/nginx/centos-7/Dockerfile +++ b/docker/nginx/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/centos-7/conf/etc/nginx/nginx.conf b/docker/nginx/centos-7/conf/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/docker/nginx/centos-7/conf/etc/nginx/nginx.conf +++ b/docker/nginx/centos-7/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/nginx/centos-7/conf/etc/nginx/vhost.conf b/docker/nginx/centos-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/centos-7/conf/etc/nginx/vhost.conf +++ b/docker/nginx/centos-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/debian-7/Dockerfile b/docker/nginx/debian-7/Dockerfile index 4d7cc76db..22d3aac83 100644 --- a/docker/nginx/debian-7/Dockerfile +++ b/docker/nginx/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/debian-7/conf/etc/nginx/vhost.conf b/docker/nginx/debian-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/debian-7/conf/etc/nginx/vhost.conf +++ b/docker/nginx/debian-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/debian-8/Dockerfile b/docker/nginx/debian-8/Dockerfile index 17f94a5df..354f5717d 100644 --- a/docker/nginx/debian-8/Dockerfile +++ b/docker/nginx/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/debian-8/conf/etc/nginx/vhost.conf b/docker/nginx/debian-8/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/debian-8/conf/etc/nginx/vhost.conf +++ b/docker/nginx/debian-8/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/debian-9/Dockerfile b/docker/nginx/debian-9/Dockerfile index e04f566d0..74873cd55 100644 --- a/docker/nginx/debian-9/Dockerfile +++ b/docker/nginx/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/debian-9/conf/etc/nginx/vhost.conf b/docker/nginx/debian-9/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/debian-9/conf/etc/nginx/vhost.conf +++ b/docker/nginx/debian-9/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/ubuntu-12.04/Dockerfile b/docker/nginx/ubuntu-12.04/Dockerfile index eb1b8bcf7..3658702ea 100644 --- a/docker/nginx/ubuntu-12.04/Dockerfile +++ b/docker/nginx/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf b/docker/nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf +++ b/docker/nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/ubuntu-14.04/Dockerfile b/docker/nginx/ubuntu-14.04/Dockerfile index 2761ba50c..34818af52 100644 --- a/docker/nginx/ubuntu-14.04/Dockerfile +++ b/docker/nginx/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf b/docker/nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf +++ b/docker/nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/ubuntu-15.04/Dockerfile b/docker/nginx/ubuntu-15.04/Dockerfile index 00711b8c4..b7382b83f 100644 --- a/docker/nginx/ubuntu-15.04/Dockerfile +++ b/docker/nginx/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf b/docker/nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf +++ b/docker/nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/ubuntu-15.10/Dockerfile b/docker/nginx/ubuntu-15.10/Dockerfile index 8c7506b7f..57ba761b5 100644 --- a/docker/nginx/ubuntu-15.10/Dockerfile +++ b/docker/nginx/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf b/docker/nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf +++ b/docker/nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/nginx/ubuntu-16.04/Dockerfile b/docker/nginx/ubuntu-16.04/Dockerfile index 2894ab0c0..45541a1a3 100644 --- a/docker/nginx/ubuntu-16.04/Dockerfile +++ b/docker/nginx/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf b/docker/nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf +++ b/docker/nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-apache-dev/alpine-3-php7/Dockerfile b/docker/php-apache-dev/alpine-3-php7/Dockerfile index 7d6fdfd92..c5a3b56e6 100644 --- a/docker/php-apache-dev/alpine-3-php7/Dockerfile +++ b/docker/php-apache-dev/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:alpine-3-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/alpine-3/Dockerfile b/docker/php-apache-dev/alpine-3/Dockerfile index 11f2227f9..747df1cf1 100644 --- a/docker/php-apache-dev/alpine-3/Dockerfile +++ b/docker/php-apache-dev/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/alpine-3/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/alpine-3/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/alpine-3/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/alpine-3/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/centos-7-php56/Dockerfile b/docker/php-apache-dev/centos-7-php56/Dockerfile index c4c07f0c8..83656c10e 100644 --- a/docker/php-apache-dev/centos-7-php56/Dockerfile +++ b/docker/php-apache-dev/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:centos-7-php56 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/centos-7/Dockerfile b/docker/php-apache-dev/centos-7/Dockerfile index 55b6f832b..aa6b13981 100644 --- a/docker/php-apache-dev/centos-7/Dockerfile +++ b/docker/php-apache-dev/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/centos-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/centos-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/centos-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/centos-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/debian-7/Dockerfile b/docker/php-apache-dev/debian-7/Dockerfile index 7c353ced0..b19a80a25 100644 --- a/docker/php-apache-dev/debian-7/Dockerfile +++ b/docker/php-apache-dev/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/debian-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/debian-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/debian-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/debian-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/debian-8-php7/Dockerfile b/docker/php-apache-dev/debian-8-php7/Dockerfile index 15e56aeb4..b4802df93 100644 --- a/docker/php-apache-dev/debian-8-php7/Dockerfile +++ b/docker/php-apache-dev/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-8-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/debian-8/Dockerfile b/docker/php-apache-dev/debian-8/Dockerfile index f18988b98..87966eb7a 100644 --- a/docker/php-apache-dev/debian-8/Dockerfile +++ b/docker/php-apache-dev/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/debian-8/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/debian-8/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/debian-8/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/debian-8/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/debian-9/Dockerfile b/docker/php-apache-dev/debian-9/Dockerfile index 0a9e1bb70..a1fb29609 100644 --- a/docker/php-apache-dev/debian-9/Dockerfile +++ b/docker/php-apache-dev/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/debian-9/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/debian-9/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/debian-9/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/debian-9/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/ubuntu-12.04/Dockerfile b/docker/php-apache-dev/ubuntu-12.04/Dockerfile index b28afb861..d62f9cdc7 100644 --- a/docker/php-apache-dev/ubuntu-12.04/Dockerfile +++ b/docker/php-apache-dev/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/ubuntu-14.04/Dockerfile b/docker/php-apache-dev/ubuntu-14.04/Dockerfile index 01ef6e1e1..b2456167c 100644 --- a/docker/php-apache-dev/ubuntu-14.04/Dockerfile +++ b/docker/php-apache-dev/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/ubuntu-15.04/Dockerfile b/docker/php-apache-dev/ubuntu-15.04/Dockerfile index f3ae7dcf3..c882f255e 100644 --- a/docker/php-apache-dev/ubuntu-15.04/Dockerfile +++ b/docker/php-apache-dev/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/ubuntu-15.10/Dockerfile b/docker/php-apache-dev/ubuntu-15.10/Dockerfile index f31ec0f33..90611e37e 100644 --- a/docker/php-apache-dev/ubuntu-15.10/Dockerfile +++ b/docker/php-apache-dev/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache-dev/ubuntu-16.04/Dockerfile b/docker/php-apache-dev/ubuntu-16.04/Dockerfile index 27ad97e6f..d64a860cb 100644 --- a/docker/php-apache-dev/ubuntu-16.04/Dockerfile +++ b/docker/php-apache-dev/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache-dev/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache-dev/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache-dev/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache-dev/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache-dev/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache-dev/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache-dev/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache-dev/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/alpine-3-php7/Dockerfile b/docker/php-apache/alpine-3-php7/Dockerfile index 23660aa18..6b0b2eb37 100644 --- a/docker/php-apache/alpine-3-php7/Dockerfile +++ b/docker/php-apache/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/alpine-3-php7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/alpine-3-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/alpine-3/Dockerfile b/docker/php-apache/alpine-3/Dockerfile index db727558e..acaf2d266 100644 --- a/docker/php-apache/alpine-3/Dockerfile +++ b/docker/php-apache/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/alpine-3/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/alpine-3/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/centos-7-php56/Dockerfile b/docker/php-apache/centos-7-php56/Dockerfile index ec44f778d..0d324cc91 100644 --- a/docker/php-apache/centos-7-php56/Dockerfile +++ b/docker/php-apache/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7-php56 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/centos-7-php56/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/centos-7-php56/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/centos-7/Dockerfile b/docker/php-apache/centos-7/Dockerfile index 8e9b6ad65..ed5e838ac 100644 --- a/docker/php-apache/centos-7/Dockerfile +++ b/docker/php-apache/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/centos-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/centos-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/debian-7/Dockerfile b/docker/php-apache/debian-7/Dockerfile index ba2fdc42e..6d45662c7 100644 --- a/docker/php-apache/debian-7/Dockerfile +++ b/docker/php-apache/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/debian-7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/debian-7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/debian-8-php7/Dockerfile b/docker/php-apache/debian-8-php7/Dockerfile index 8a67ebbba..7d83886da 100644 --- a/docker/php-apache/debian-8-php7/Dockerfile +++ b/docker/php-apache/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/debian-8-php7/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/debian-8-php7/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/debian-8/Dockerfile b/docker/php-apache/debian-8/Dockerfile index a01d3e156..dea5f35a2 100644 --- a/docker/php-apache/debian-8/Dockerfile +++ b/docker/php-apache/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/debian-8/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/debian-8/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/debian-9/Dockerfile b/docker/php-apache/debian-9/Dockerfile index e49913eeb..f90d4d1dc 100644 --- a/docker/php-apache/debian-9/Dockerfile +++ b/docker/php-apache/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/debian-9/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/debian-9/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/ubuntu-12.04/Dockerfile b/docker/php-apache/ubuntu-12.04/Dockerfile index d95c0938a..c2daeb41d 100644 --- a/docker/php-apache/ubuntu-12.04/Dockerfile +++ b/docker/php-apache/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/ubuntu-12.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/ubuntu-12.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/ubuntu-14.04/Dockerfile b/docker/php-apache/ubuntu-14.04/Dockerfile index cf6d2762e..ea186594d 100644 --- a/docker/php-apache/ubuntu-14.04/Dockerfile +++ b/docker/php-apache/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/ubuntu-14.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/ubuntu-14.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/ubuntu-15.04/Dockerfile b/docker/php-apache/ubuntu-15.04/Dockerfile index f25c77627..f94599e4f 100644 --- a/docker/php-apache/ubuntu-15.04/Dockerfile +++ b/docker/php-apache/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/ubuntu-15.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/ubuntu-15.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/ubuntu-15.10/Dockerfile b/docker/php-apache/ubuntu-15.10/Dockerfile index c3dfc343d..f1e4f74c9 100644 --- a/docker/php-apache/ubuntu-15.10/Dockerfile +++ b/docker/php-apache/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/ubuntu-15.10/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/ubuntu-15.10/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-apache/ubuntu-16.04/Dockerfile b/docker/php-apache/ubuntu-16.04/Dockerfile index 2eb138bb4..f237d5e74 100644 --- a/docker/php-apache/ubuntu-16.04/Dockerfile +++ b/docker/php-apache/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/docker/php-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh +++ b/docker/php-apache/ubuntu-16.04/conf/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/docker/php-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml b/docker/php-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/docker/php-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/docker/php-apache/ubuntu-16.04/conf/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/docker/php-dev/alpine-3-php7/Dockerfile b/docker/php-dev/alpine-3-php7/Dockerfile index 567e5321c..70389c1b5 100644 --- a/docker/php-dev/alpine-3-php7/Dockerfile +++ b/docker/php-dev/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/alpine-3/Dockerfile b/docker/php-dev/alpine-3/Dockerfile index c5d6d852c..d94cc181f 100644 --- a/docker/php-dev/alpine-3/Dockerfile +++ b/docker/php-dev/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/centos-7-php56/Dockerfile b/docker/php-dev/centos-7-php56/Dockerfile index 948f94ae3..d49cfbe16 100644 --- a/docker/php-dev/centos-7-php56/Dockerfile +++ b/docker/php-dev/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7-php56 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/centos-7/Dockerfile b/docker/php-dev/centos-7/Dockerfile index 7dfa75e1b..c9f5b2c42 100644 --- a/docker/php-dev/centos-7/Dockerfile +++ b/docker/php-dev/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/debian-7/Dockerfile b/docker/php-dev/debian-7/Dockerfile index 3e91c3ab4..e6891bb7b 100644 --- a/docker/php-dev/debian-7/Dockerfile +++ b/docker/php-dev/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/debian-8-php7/Dockerfile b/docker/php-dev/debian-8-php7/Dockerfile index 03bbd2de6..ad50d0c9d 100644 --- a/docker/php-dev/debian-8-php7/Dockerfile +++ b/docker/php-dev/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/debian-8/Dockerfile b/docker/php-dev/debian-8/Dockerfile index b91015cd3..b18b0652c 100644 --- a/docker/php-dev/debian-8/Dockerfile +++ b/docker/php-dev/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/debian-9/Dockerfile b/docker/php-dev/debian-9/Dockerfile index ffa68f3fa..c854e548f 100644 --- a/docker/php-dev/debian-9/Dockerfile +++ b/docker/php-dev/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/ubuntu-12.04/Dockerfile b/docker/php-dev/ubuntu-12.04/Dockerfile index 5931ac856..026946579 100644 --- a/docker/php-dev/ubuntu-12.04/Dockerfile +++ b/docker/php-dev/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/ubuntu-14.04/Dockerfile b/docker/php-dev/ubuntu-14.04/Dockerfile index d9678cb2a..8b9fba74f 100644 --- a/docker/php-dev/ubuntu-14.04/Dockerfile +++ b/docker/php-dev/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/ubuntu-15.04/Dockerfile b/docker/php-dev/ubuntu-15.04/Dockerfile index ae44a7b5e..172d9ee26 100644 --- a/docker/php-dev/ubuntu-15.04/Dockerfile +++ b/docker/php-dev/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/ubuntu-15.10/Dockerfile b/docker/php-dev/ubuntu-15.10/Dockerfile index 920be48f1..7f0f77961 100644 --- a/docker/php-dev/ubuntu-15.10/Dockerfile +++ b/docker/php-dev/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-dev/ubuntu-16.04/Dockerfile b/docker/php-dev/ubuntu-16.04/Dockerfile index 8410f9274..388f72c29 100644 --- a/docker/php-dev/ubuntu-16.04/Dockerfile +++ b/docker/php-dev/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/php-nginx-dev/alpine-3-php7/Dockerfile b/docker/php-nginx-dev/alpine-3-php7/Dockerfile index 369b56aff..ea2cd32f3 100644 --- a/docker/php-nginx-dev/alpine-3-php7/Dockerfile +++ b/docker/php-nginx-dev/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:alpine-3-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/nginx.conf b/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/alpine-3-php7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/alpine-3/Dockerfile b/docker/php-nginx-dev/alpine-3/Dockerfile index 073163795..920440d6e 100644 --- a/docker/php-nginx-dev/alpine-3/Dockerfile +++ b/docker/php-nginx-dev/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/alpine-3/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/alpine-3/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/alpine-3/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/alpine-3/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/alpine-3/conf/etc/nginx/nginx.conf b/docker/php-nginx-dev/alpine-3/conf/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/docker/php-nginx-dev/alpine-3/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx-dev/alpine-3/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx-dev/alpine-3/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/alpine-3/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/alpine-3/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/alpine-3/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/centos-7-php56/Dockerfile b/docker/php-nginx-dev/centos-7-php56/Dockerfile index 822352fba..a30602219 100644 --- a/docker/php-nginx-dev/centos-7-php56/Dockerfile +++ b/docker/php-nginx-dev/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:centos-7-php56 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/nginx.conf b/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/centos-7-php56/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/centos-7/Dockerfile b/docker/php-nginx-dev/centos-7/Dockerfile index 0cbb4d7bf..b33a10a0c 100644 --- a/docker/php-nginx-dev/centos-7/Dockerfile +++ b/docker/php-nginx-dev/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/centos-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/centos-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/centos-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/centos-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/centos-7/conf/etc/nginx/nginx.conf b/docker/php-nginx-dev/centos-7/conf/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/docker/php-nginx-dev/centos-7/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx-dev/centos-7/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx-dev/centos-7/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/centos-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/centos-7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/centos-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/debian-7/Dockerfile b/docker/php-nginx-dev/debian-7/Dockerfile index 116f6e887..81f18121d 100644 --- a/docker/php-nginx-dev/debian-7/Dockerfile +++ b/docker/php-nginx-dev/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/debian-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/debian-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/debian-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/debian-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/debian-7/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/debian-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/debian-7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/debian-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/debian-8-php7/Dockerfile b/docker/php-nginx-dev/debian-8-php7/Dockerfile index 7d11af2c0..f937d8b65 100644 --- a/docker/php-nginx-dev/debian-8-php7/Dockerfile +++ b/docker/php-nginx-dev/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-8-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/debian-8-php7/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/debian-8-php7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/debian-8-php7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/debian-8-php7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/debian-8/Dockerfile b/docker/php-nginx-dev/debian-8/Dockerfile index 517112d8e..d293fd8d2 100644 --- a/docker/php-nginx-dev/debian-8/Dockerfile +++ b/docker/php-nginx-dev/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/debian-8/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/debian-8/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/debian-8/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/debian-8/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/debian-8/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/debian-8/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/debian-8/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/debian-8/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/debian-9/Dockerfile b/docker/php-nginx-dev/debian-9/Dockerfile index 5ec1b1317..48add8178 100644 --- a/docker/php-nginx-dev/debian-9/Dockerfile +++ b/docker/php-nginx-dev/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/debian-9/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/debian-9/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/debian-9/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/debian-9/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/debian-9/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/debian-9/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/debian-9/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/debian-9/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/ubuntu-12.04/Dockerfile b/docker/php-nginx-dev/ubuntu-12.04/Dockerfile index cf54700b9..28e738e33 100644 --- a/docker/php-nginx-dev/ubuntu-12.04/Dockerfile +++ b/docker/php-nginx-dev/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/ubuntu-12.04/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/ubuntu-12.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/ubuntu-12.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/ubuntu-12.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/ubuntu-14.04/Dockerfile b/docker/php-nginx-dev/ubuntu-14.04/Dockerfile index eec0fa1b6..4f1ed5bba 100644 --- a/docker/php-nginx-dev/ubuntu-14.04/Dockerfile +++ b/docker/php-nginx-dev/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/ubuntu-14.04/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/ubuntu-14.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/ubuntu-14.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/ubuntu-14.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/ubuntu-15.04/Dockerfile b/docker/php-nginx-dev/ubuntu-15.04/Dockerfile index cc324b1c8..a309b922a 100644 --- a/docker/php-nginx-dev/ubuntu-15.04/Dockerfile +++ b/docker/php-nginx-dev/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/ubuntu-15.04/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/ubuntu-15.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/ubuntu-15.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/ubuntu-15.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/ubuntu-15.10/Dockerfile b/docker/php-nginx-dev/ubuntu-15.10/Dockerfile index 45eec0393..bfe017b08 100644 --- a/docker/php-nginx-dev/ubuntu-15.10/Dockerfile +++ b/docker/php-nginx-dev/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/ubuntu-15.10/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/ubuntu-15.10/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/ubuntu-15.10/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/ubuntu-15.10/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx-dev/ubuntu-16.04/Dockerfile b/docker/php-nginx-dev/ubuntu-16.04/Dockerfile index b011d84fe..3bd390cbd 100644 --- a/docker/php-nginx-dev/ubuntu-16.04/Dockerfile +++ b/docker/php-nginx-dev/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-dev:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx-dev/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx-dev/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx-dev/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx-dev/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx-dev/ubuntu-16.04/conf/etc/nginx/vhost.conf b/docker/php-nginx-dev/ubuntu-16.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx-dev/ubuntu-16.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx-dev/ubuntu-16.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx-dev/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx-dev/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx-dev/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx-dev/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/alpine-3-php7/Dockerfile b/docker/php-nginx/alpine-3-php7/Dockerfile index aa1201452..a2a4289c9 100644 --- a/docker/php-nginx/alpine-3-php7/Dockerfile +++ b/docker/php-nginx/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/alpine-3-php7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/alpine-3-php7/conf/etc/nginx/nginx.conf b/docker/php-nginx/alpine-3-php7/conf/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/docker/php-nginx/alpine-3-php7/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx/alpine-3-php7/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx/alpine-3-php7/conf/etc/nginx/vhost.conf b/docker/php-nginx/alpine-3-php7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/alpine-3-php7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/alpine-3-php7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/alpine-3-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/alpine-3/Dockerfile b/docker/php-nginx/alpine-3/Dockerfile index 4b07af2f3..e7d8bff57 100644 --- a/docker/php-nginx/alpine-3/Dockerfile +++ b/docker/php-nginx/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/alpine-3/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/alpine-3/conf/etc/nginx/nginx.conf b/docker/php-nginx/alpine-3/conf/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/docker/php-nginx/alpine-3/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx/alpine-3/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx/alpine-3/conf/etc/nginx/vhost.conf b/docker/php-nginx/alpine-3/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/alpine-3/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/alpine-3/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/alpine-3/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/centos-7-php56/Dockerfile b/docker/php-nginx/centos-7-php56/Dockerfile index 69aaf1371..a0995e7c8 100644 --- a/docker/php-nginx/centos-7-php56/Dockerfile +++ b/docker/php-nginx/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7-php56 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/centos-7-php56/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/centos-7-php56/conf/etc/nginx/nginx.conf b/docker/php-nginx/centos-7-php56/conf/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/docker/php-nginx/centos-7-php56/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx/centos-7-php56/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx/centos-7-php56/conf/etc/nginx/vhost.conf b/docker/php-nginx/centos-7-php56/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/centos-7-php56/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/centos-7-php56/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/centos-7-php56/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/centos-7/Dockerfile b/docker/php-nginx/centos-7/Dockerfile index 6903c0633..c37dba72a 100644 --- a/docker/php-nginx/centos-7/Dockerfile +++ b/docker/php-nginx/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/centos-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/centos-7/conf/etc/nginx/nginx.conf b/docker/php-nginx/centos-7/conf/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/docker/php-nginx/centos-7/conf/etc/nginx/nginx.conf +++ b/docker/php-nginx/centos-7/conf/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/docker/php-nginx/centos-7/conf/etc/nginx/vhost.conf b/docker/php-nginx/centos-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/centos-7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/centos-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/centos-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/debian-7/Dockerfile b/docker/php-nginx/debian-7/Dockerfile index 2e743f75f..aad754c83 100644 --- a/docker/php-nginx/debian-7/Dockerfile +++ b/docker/php-nginx/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/debian-7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/debian-7/conf/etc/nginx/vhost.conf b/docker/php-nginx/debian-7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/debian-7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/debian-7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/debian-7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/debian-8-php7/Dockerfile b/docker/php-nginx/debian-8-php7/Dockerfile index 3e4c441c6..8c15a3281 100644 --- a/docker/php-nginx/debian-8-php7/Dockerfile +++ b/docker/php-nginx/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8-php7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/debian-8-php7/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/debian-8-php7/conf/etc/nginx/vhost.conf b/docker/php-nginx/debian-8-php7/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/debian-8-php7/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/debian-8-php7/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/debian-8-php7/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/debian-8/Dockerfile b/docker/php-nginx/debian-8/Dockerfile index 3915c788b..ca444dc7e 100644 --- a/docker/php-nginx/debian-8/Dockerfile +++ b/docker/php-nginx/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/debian-8/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/debian-8/conf/etc/nginx/vhost.conf b/docker/php-nginx/debian-8/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/debian-8/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/debian-8/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/debian-8/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/debian-9/Dockerfile b/docker/php-nginx/debian-9/Dockerfile index 3c1ab8412..1caa4cc29 100644 --- a/docker/php-nginx/debian-9/Dockerfile +++ b/docker/php-nginx/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/debian-9/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/debian-9/conf/etc/nginx/vhost.conf b/docker/php-nginx/debian-9/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/debian-9/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/debian-9/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/debian-9/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/ubuntu-12.04/Dockerfile b/docker/php-nginx/ubuntu-12.04/Dockerfile index 07899e94e..6413da77a 100644 --- a/docker/php-nginx/ubuntu-12.04/Dockerfile +++ b/docker/php-nginx/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/ubuntu-12.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf b/docker/php-nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/ubuntu-12.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/ubuntu-12.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/ubuntu-14.04/Dockerfile b/docker/php-nginx/ubuntu-14.04/Dockerfile index 9a49fcc59..4251f39b5 100644 --- a/docker/php-nginx/ubuntu-14.04/Dockerfile +++ b/docker/php-nginx/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/ubuntu-14.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf b/docker/php-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/ubuntu-14.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/ubuntu-14.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/ubuntu-15.04/Dockerfile b/docker/php-nginx/ubuntu-15.04/Dockerfile index c24720df2..056e6c0a5 100644 --- a/docker/php-nginx/ubuntu-15.04/Dockerfile +++ b/docker/php-nginx/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/ubuntu-15.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf b/docker/php-nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/ubuntu-15.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/ubuntu-15.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/ubuntu-15.10/Dockerfile b/docker/php-nginx/ubuntu-15.10/Dockerfile index e30bb7d12..d6e7b84b6 100644 --- a/docker/php-nginx/ubuntu-15.10/Dockerfile +++ b/docker/php-nginx/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/ubuntu-15.10/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf b/docker/php-nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/ubuntu-15.10/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/ubuntu-15.10/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php-nginx/ubuntu-16.04/Dockerfile b/docker/php-nginx/ubuntu-16.04/Dockerfile index a331bd08d..d244348d2 100644 --- a/docker/php-nginx/ubuntu-16.04/Dockerfile +++ b/docker/php-nginx/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/docker/php-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh +++ b/docker/php-nginx/ubuntu-16.04/conf/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/docker/php-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf b/docker/php-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/docker/php-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf +++ b/docker/php-nginx/ubuntu-16.04/conf/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/docker/php-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/docker/php-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/docker/php-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/docker/php-nginx/ubuntu-16.04/conf/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/docker/php/alpine-3-php7/Dockerfile b/docker/php/alpine-3-php7/Dockerfile index 41b4401d4..d219c7667 100644 --- a/docker/php/alpine-3-php7/Dockerfile +++ b/docker/php/alpine-3-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/alpine-3-php7/conf/etc/supervisor.d/php-fpm.conf b/docker/php/alpine-3-php7/conf/etc/supervisor.d/php-fpm.conf index 5504e92a1..5781f5b0a 100644 --- a/docker/php/alpine-3-php7/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/alpine-3-php7/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php7-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php7-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php7-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php7-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 82c7effa6..36143a96f 100644 --- a/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -49,5 +49,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php7-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php7-fpm.pid" } + - { key: 'error_log', value: "syslog" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index e4ed521b3..9ea260579 100644 --- a/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/alpine-3-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -72,9 +72,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php7-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php7-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php7-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'clear_env', value: "no" } - { key: 'user', value: "{{ APPLICATION_USER }}" } diff --git a/docker/php/alpine-3/Dockerfile b/docker/php/alpine-3/Dockerfile index ae82ee413..54cb91855 100644 --- a/docker/php/alpine-3/Dockerfile +++ b/docker/php/alpine-3/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/alpine-3/conf/etc/supervisor.d/php-fpm.conf b/docker/php/alpine-3/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/alpine-3/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/alpine-3/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/alpine-3/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/centos-7-php56/Dockerfile b/docker/php/centos-7-php56/Dockerfile index 74be0aa16..9d7a8a843 100644 --- a/docker/php/centos-7-php56/Dockerfile +++ b/docker/php/centos-7-php56/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/centos-7-php56/conf/etc/supervisor.d/php-fpm.conf b/docker/php/centos-7-php56/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/centos-7-php56/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/centos-7-php56/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/centos-7-php56/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/centos-7/Dockerfile b/docker/php/centos-7/Dockerfile index 6278a5776..b53229d95 100644 --- a/docker/php/centos-7/Dockerfile +++ b/docker/php/centos-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:centos-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/centos-7/conf/etc/supervisor.d/php-fpm.conf b/docker/php/centos-7/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/centos-7/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/centos-7/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/centos-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/debian-7/Dockerfile b/docker/php/debian-7/Dockerfile index 89ddce235..d855eda02 100644 --- a/docker/php/debian-7/Dockerfile +++ b/docker/php/debian-7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:debian-7 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/debian-7/conf/etc/supervisor.d/php-fpm.conf b/docker/php/debian-7/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/debian-7/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/debian-7/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/debian-7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/debian-8-php7/Dockerfile b/docker/php/debian-8-php7/Dockerfile index 2b047c61b..7b6653518 100644 --- a/docker/php/debian-8-php7/Dockerfile +++ b/docker/php/debian-8-php7/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/debian-8-php7/conf/etc/supervisor.d/php-fpm.conf b/docker/php/debian-8-php7/conf/etc/supervisor.d/php-fpm.conf index 5504e92a1..5781f5b0a 100644 --- a/docker/php/debian-8-php7/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/debian-8-php7/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php7-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php7-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php7-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php7-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 82c7effa6..36143a96f 100644 --- a/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -49,5 +49,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php7-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php7-fpm.pid" } + - { key: 'error_log', value: "syslog" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index e4ed521b3..9ea260579 100644 --- a/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/debian-8-php7/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -72,9 +72,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php7-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php7-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php7-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'clear_env', value: "no" } - { key: 'user', value: "{{ APPLICATION_USER }}" } diff --git a/docker/php/debian-8/Dockerfile b/docker/php/debian-8/Dockerfile index e1a6bbfa8..2981e523a 100644 --- a/docker/php/debian-8/Dockerfile +++ b/docker/php/debian-8/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:debian-8 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/debian-8/conf/etc/supervisor.d/php-fpm.conf b/docker/php/debian-8/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/debian-8/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/debian-8/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/debian-8/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/debian-9/Dockerfile b/docker/php/debian-9/Dockerfile index 736c55c51..91ad676a0 100644 --- a/docker/php/debian-9/Dockerfile +++ b/docker/php/debian-9/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:debian-9 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/debian-9/conf/etc/supervisor.d/php-fpm.conf b/docker/php/debian-9/conf/etc/supervisor.d/php-fpm.conf index 5504e92a1..5781f5b0a 100644 --- a/docker/php/debian-9/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/debian-9/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php7-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php7-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php7-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php7-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 82c7effa6..36143a96f 100644 --- a/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -49,5 +49,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php7-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php7-fpm.pid" } + - { key: 'error_log', value: "syslog" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index e4ed521b3..9ea260579 100644 --- a/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/debian-9/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -72,9 +72,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php7-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php7-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php7-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'clear_env', value: "no" } - { key: 'user', value: "{{ APPLICATION_USER }}" } diff --git a/docker/php/ubuntu-12.04/Dockerfile b/docker/php/ubuntu-12.04/Dockerfile index ee65f1938..06b7b1e3f 100644 --- a/docker/php/ubuntu-12.04/Dockerfile +++ b/docker/php/ubuntu-12.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-12.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/ubuntu-12.04/conf/etc/supervisor.d/php-fpm.conf b/docker/php/ubuntu-12.04/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/ubuntu-12.04/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/ubuntu-12.04/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/ubuntu-12.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/ubuntu-14.04/Dockerfile b/docker/php/ubuntu-14.04/Dockerfile index 8133685b2..602794c71 100644 --- a/docker/php/ubuntu-14.04/Dockerfile +++ b/docker/php/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/ubuntu-14.04/conf/etc/supervisor.d/php-fpm.conf b/docker/php/ubuntu-14.04/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/ubuntu-14.04/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/ubuntu-14.04/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/ubuntu-14.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/ubuntu-15.04/Dockerfile b/docker/php/ubuntu-15.04/Dockerfile index 35e8230be..28e380cc2 100644 --- a/docker/php/ubuntu-15.04/Dockerfile +++ b/docker/php/ubuntu-15.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-15.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/ubuntu-15.04/conf/etc/supervisor.d/php-fpm.conf b/docker/php/ubuntu-15.04/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/ubuntu-15.04/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/ubuntu-15.04/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/ubuntu-15.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/ubuntu-15.10/Dockerfile b/docker/php/ubuntu-15.10/Dockerfile index 8774ffdf2..7e0cae16a 100644 --- a/docker/php/ubuntu-15.10/Dockerfile +++ b/docker/php/ubuntu-15.10/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-15.10 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/ubuntu-15.10/conf/etc/supervisor.d/php-fpm.conf b/docker/php/ubuntu-15.10/conf/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/docker/php/ubuntu-15.10/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/ubuntu-15.10/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/ubuntu-15.10/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/docker/php/ubuntu-16.04/Dockerfile b/docker/php/ubuntu-16.04/Dockerfile index b4c53e1cd..68affaace 100644 --- a/docker/php/ubuntu-16.04/Dockerfile +++ b/docker/php/ubuntu-16.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:ubuntu-16.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app ENV WEB_DOCUMENT_INDEX index.php diff --git a/docker/php/ubuntu-16.04/conf/etc/supervisor.d/php-fpm.conf b/docker/php/ubuntu-16.04/conf/etc/supervisor.d/php-fpm.conf index 5504e92a1..5781f5b0a 100644 --- a/docker/php/ubuntu-16.04/conf/etc/supervisor.d/php-fpm.conf +++ b/docker/php/ubuntu-16.04/conf/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php7-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php7-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php7-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php7-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 82c7effa6..36143a96f 100644 --- a/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -49,5 +49,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php7-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php7-fpm.pid" } + - { key: 'error_log', value: "syslog" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index e4ed521b3..9ea260579 100644 --- a/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/docker/php/ubuntu-16.04/conf/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -72,9 +72,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php7-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php7-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php7-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'clear_env', value: "no" } - { key: 'user', value: "{{ APPLICATION_USER }}" } diff --git a/docker/piwik/ubuntu-14.04/Dockerfile b/docker/piwik/ubuntu-14.04/Dockerfile index b901ec917..7f665e554 100644 --- a/docker/piwik/ubuntu-14.04/Dockerfile +++ b/docker/piwik/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-nginx:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app/piwik/ ENV PIWIK_URL http://example.com/ diff --git a/docker/postfix/latest/Dockerfile b/docker/postfix/latest/Dockerfile index d5b8ed93c..cf8a0aa69 100644 --- a/docker/postfix/latest/Dockerfile +++ b/docker/postfix/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 COPY conf/ /opt/docker/ diff --git a/docker/samson-deployment/latest/Dockerfile b/docker/samson-deployment/latest/Dockerfile index a6ae8c879..c6b7cbf84 100644 --- a/docker/samson-deployment/latest/Dockerfile +++ b/docker/samson-deployment/latest/Dockerfile @@ -8,7 +8,7 @@ FROM zendesk/samson:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ############################################################################### @@ -61,7 +61,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete ############################################################################### # Base diff --git a/docker/samson-deployment/latest/conf/bin/config.sh b/docker/samson-deployment/latest/conf/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/docker/samson-deployment/latest/conf/bin/config.sh +++ b/docker/samson-deployment/latest/conf/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/docker/samson-deployment/latest/conf/bin/entrypoint.sh b/docker/samson-deployment/latest/conf/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/docker/samson-deployment/latest/conf/bin/entrypoint.sh +++ b/docker/samson-deployment/latest/conf/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/docker/samson-deployment/latest/conf/bin/provision b/docker/samson-deployment/latest/conf/bin/provision old mode 100644 new mode 100755 diff --git a/docker/samson-deployment/latest/conf/bin/provision-run.sh b/docker/samson-deployment/latest/conf/bin/provision-run.sh deleted file mode 100644 index 21c1193a2..000000000 --- a/docker/samson-deployment/latest/conf/bin/provision-run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -BOOTSTRAP_MODE="bootstrap" - -if [ -n "$1" ]; then - BOOTSTRAP_MODE="$1" -fi - -set -o pipefail # trace ERR through pipes -set -o errtrace # trace ERR through 'time command' and other functions -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errexit ## set -e : exit the script if any statement returns a non-true return value - -source /opt/docker/bin/config.sh - -rootCheck - -# TODO: currently only registering roles -for role in "$@"; do - /opt/docker/bin/control.sh provision.role.bootstrap "$role" -done diff --git a/docker/samson-deployment/latest/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/samson-deployment/latest/conf/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/docker/samson-deployment/latest/conf/bin/service.d/dnsmasq.d/10-init.sh +++ b/docker/samson-deployment/latest/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/docker/samson-deployment/latest/conf/bin/service.d/postfix.d/10-init.sh b/docker/samson-deployment/latest/conf/bin/service.d/postfix.d/10-init.sh index 923002f39..9dc7c8af2 100644 --- a/docker/samson-deployment/latest/conf/bin/service.d/postfix.d/10-init.sh +++ b/docker/samson-deployment/latest/conf/bin/service.d/postfix.d/10-init.sh @@ -4,10 +4,14 @@ cp -f /etc/hosts /var/spool/postfix/etc/hosts cp -f /etc/resolv.conf /var/spool/postfix/etc/resolv.conf cp -f /etc/services /var/spool/postfix/etc/services -if [[ -n "${POSTFIX_RELAYHOST+x}" ]]; else +if [[ -n "${POSTFIX_RELAYHOST+x}" ]]; then + # replace line + sed -i '/relayhost[ ]* =/c\' main.cf echo "relayhost = $POSTFIX_RELAYHOST" >> /etc/postfix/main.cf fi -if [[ -n "${POSTFIX_MYNETWORKS+x}" ]]; else +if [[ -n "${POSTFIX_MYNETWORKS+x}" ]]; then + # replace line + sed -i '/mynetworks[ ]* =/c\' main.cf echo "mynetworks = $POSTFIX_MYNETWORKS" >> /etc/postfix/main.cf fi diff --git a/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.d/10-init.sh +++ b/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.sh b/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.sh +++ b/docker/samson-deployment/latest/conf/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/docker/samson-deployment/latest/conf/etc/supervisor.conf b/docker/samson-deployment/latest/conf/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/docker/samson-deployment/latest/conf/etc/supervisor.conf +++ b/docker/samson-deployment/latest/conf/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/docker/samson-deployment/latest/conf/etc/supervisor.d/postfix.conf b/docker/samson-deployment/latest/conf/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/docker/samson-deployment/latest/conf/etc/supervisor.d/postfix.conf +++ b/docker/samson-deployment/latest/conf/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/docker/samson-deployment/latest/conf/etc/supervisor.d/syslog-ng.conf b/docker/samson-deployment/latest/conf/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/docker/samson-deployment/latest/conf/etc/supervisor.d/syslog-ng.conf +++ b/docker/samson-deployment/latest/conf/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/samson-deployment/latest/conf/etc/syslog-ng/syslog-ng.conf b/docker/samson-deployment/latest/conf/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/docker/samson-deployment/latest/conf/etc/syslog-ng/syslog-ng.conf +++ b/docker/samson-deployment/latest/conf/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/docker/samson-deployment/latest/conf/provision/build.d/10-cleanup.sh b/docker/samson-deployment/latest/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/docker/samson-deployment/latest/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/dnsmasq.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/dnsmasq.yml deleted file mode 100644 index 962a7953a..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/dnsmasq.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Configure dnsmasq - lineinfile: - dest: /etc/dnsmasq.conf - regexp: '^[\s]*{{ item.key }}[\s]*=' - line: '{{ item.key }}={{ item.value }}' - with_items: - - { key: 'user', value: 'root' } - - { key: 'conf-dir', value: '/etc/dnsmasq.d' } diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/postfix.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/postfix.yml deleted file mode 100644 index 6b0ea47dc..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/postfix.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- name: Configure postfix - lineinfile: - dest: /etc/postfix/main.cf - regexp: '^[\s]*{{ item.key }}[\s]*=' - line: '{{ item.key }}={{ item.value }}' - with_items: - - { key: 'mydestination', value: '' } - - { key: 'message_size_limit', value: '15240000' } - # Hardening - - { key: 'smtp_use_tls', value: 'yes' } - - { key: 'smtp_tls_security_level', value: 'may' } diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/user.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/user.yml deleted file mode 100644 index 01b0c19cb..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/bootstrap/user.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- - -- name: Move dnsmasq group - group: - name: dnsmasq - gid: 153 - when: ansible_distribution == 'Alpine' - -- name: Create application group - group: - name: "{{ APPLICATION_GROUP }}" - gid: "{{ APPLICATION_GID }}" - -- name: Create application user - user: - name: "{{ APPLICATION_USER }}" - uid: "{{ APPLICATION_UID }}" - group: "{{ APPLICATION_GROUP }}" - shell: "/bin/bash" - home: "/home/{{ APPLICATION_USER }}" - -- name: Init home directory - file: - path: "/home/{{ APPLICATION_USER }}" - state: directory - mode: 0755 - owner: "{{ APPLICATION_USER }}" - group: "{{ APPLICATION_GROUP }}" - recurse: yes - -- name: Init bashrc - lineinfile: - dest: "/home/{{ APPLICATION_USER }}/.bashrc" - mode: 0770 - owner: "{{ APPLICATION_USER }}" - group: "{{ APPLICATION_GROUP }}" - create: yes - regexp: "export TERM=xterm" - line: "export TERM=xterm" - -- action: setup diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/logrotate.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/logrotate.yml deleted file mode 100644 index 10f7e6644..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/logrotate.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Register logrotate configurations - file: - src: '{{ item }}' - dest: '/etc/logrotate.d/{{ item | basename }}' - state: link - force: yes - with_fileglob: - - /opt/docker/etc/logrotate.d/* diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/postfix.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/postfix.yml deleted file mode 100644 index e29e33170..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/postfix.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Configure postfix - lineinfile: - dest: /etc/postfix/main.cf - regexp: '^[\s]*{{ item.key }}[\s]*=' - line: '{{ item.key }}={{ item.value }}' - with_items: - - { key: 'myhostname', value: '{{ ansible_hostname }}' } - - { key: 'mydestination', value: '{{ ansible_hostname }}' } \ No newline at end of file diff --git a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/user.yml b/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/user.yml deleted file mode 100644 index 9da1c9537..000000000 --- a/docker/samson-deployment/latest/conf/provision/roles/webdevops-base/tasks/entrypoint/user.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- - -- group: - name: "{{ APPLICATION_GROUP }}" - gid: "{{ APPLICATION_GID }}" - -- user: - name: "{{ APPLICATION_USER }}" - uid: "{{ APPLICATION_UID }}" - group: "{{ APPLICATION_GROUP }}" - shell: "/bin/bash" - home: "/home/{{ APPLICATION_USER }}" - -# create a directory if it doesn't exist -- file: - path: "/home/{{ APPLICATION_USER }}" - state: directory - mode: 0755 - owner: "{{ APPLICATION_USER }}" - group: "{{ APPLICATION_GROUP }}" - recurse: yes - -- action: setup diff --git a/docker/sphinx/latest/Dockerfile b/docker/sphinx/latest/Dockerfile index f1c2b16eb..5d662af27 100644 --- a/docker/sphinx/latest/Dockerfile +++ b/docker/sphinx/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/bootstrap:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 RUN /usr/local/bin/apk-install \ # General sphinx diff --git a/docker/ssh/latest/Dockerfile b/docker/ssh/latest/Dockerfile index 004e9205e..230f1f961 100644 --- a/docker/ssh/latest/Dockerfile +++ b/docker/ssh/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base-app:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 RUN /opt/docker/bin/control.sh service.enable ssh diff --git a/docker/storage/latest/Dockerfile b/docker/storage/latest/Dockerfile index 3abaf8def..04bce55f2 100644 --- a/docker/storage/latest/Dockerfile +++ b/docker/storage/latest/Dockerfile @@ -8,7 +8,7 @@ FROM busybox:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 RUN mkdir /storage/ \ && chmod 777 /storage/ diff --git a/docker/typo3/ubuntu-14.04/Dockerfile b/docker/typo3/ubuntu-14.04/Dockerfile index da5260e53..3de5b47e6 100644 --- a/docker/typo3/ubuntu-14.04/Dockerfile +++ b/docker/typo3/ubuntu-14.04/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/php-apache:ubuntu-14.04 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV WEB_DOCUMENT_ROOT /app/web/ diff --git a/docker/varnish/latest/Dockerfile b/docker/varnish/latest/Dockerfile index 4219852fc..14df78f24 100644 --- a/docker/varnish/latest/Dockerfile +++ b/docker/varnish/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:alpine-3 MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV VARNISH_PORT 80 diff --git a/docker/vsftp/latest/Dockerfile b/docker/vsftp/latest/Dockerfile index 17ef082a5..d1144cca6 100644 --- a/docker/vsftp/latest/Dockerfile +++ b/docker/vsftp/latest/Dockerfile @@ -8,7 +8,7 @@ FROM webdevops/base:latest MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 ENV FTP_USER application ENV FTP_PASSWORD application diff --git a/docker/vsftp/latest/conf/etc/supervisor.d/vsftp.conf b/docker/vsftp/latest/conf/etc/supervisor.d/vsftp.conf index 114305302..4442ea75a 100644 --- a/docker/vsftp/latest/conf/etc/supervisor.d/vsftp.conf +++ b/docker/vsftp/latest/conf/etc/supervisor.d/vsftp.conf @@ -1,5 +1,5 @@ [group:vsftp] -programs=vsftpd,vsftp-log +programs=vsftpd priority=20 [program:vsftpd] @@ -10,12 +10,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:vsftp-log] -command = bash /opt/docker/bin/logwatch.sh vsftp /var/log/vsftpd.log -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/docker/vsftp/latest/conf/etc/vsftpd/vsftpd.conf b/docker/vsftp/latest/conf/etc/vsftpd/vsftpd.conf index cd8877986..958f07dfa 100644 --- a/docker/vsftp/latest/conf/etc/vsftpd/vsftpd.conf +++ b/docker/vsftp/latest/conf/etc/vsftpd/vsftpd.conf @@ -21,5 +21,5 @@ file_open_mode=0666 local_umask=000 allow_writeable_chroot=YES -vsftpd_log_file=/var/log/vsftpd.log +vsftpd_log_file=/docker.stdout background=NO diff --git a/documentation/docs/content/Commands/index.rst b/documentation/docs/content/Commands/index.rst index 510363aa2..119f8ff6c 100644 --- a/documentation/docs/content/Commands/index.rst +++ b/documentation/docs/content/Commands/index.rst @@ -25,6 +25,9 @@ All commands are using configuration options from ``conf/console.yml``. bin/console tasks ----------------- +Tip: Most tasks are using arguments as whitelist addon for easier usage. + + bin/console docker:build ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -75,6 +78,25 @@ Option Description --blacklist=term Don't build Docker images with *term* in name *string value* ===================================== ================================================================================= =============================================== +bin/console docker:exec +~~~~~~~~~~~~~~~~~~~~~~~ + +Execute argument as command inside all docker images. + +eg. ``bin/console docker:exec --whitelist php -- 'php -v'`` + +Tip: Separate the docker image command arguments from the console commands with two dashes. + +===================================== ================================================================================= =============================================== +Option Description Values +===================================== ================================================================================= =============================================== +-v Verbose output *option only* +--dry-run Don't really execute build process *option only* +--whitelist=term Only build Docker images with *term* in name *string value* +--blacklist=term Don't build Docker images with *term* in name *string value* +===================================== ================================================================================= =============================================== + + bin/console test:testinfra ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/documentation/docs/content/DockerImages/dockerfiles/include/customization-apache.rst b/documentation/docs/content/DockerImages/dockerfiles/include/customization-apache.rst index 6404a8a13..59d8dac70 100644 --- a/documentation/docs/content/DockerImages/dockerfiles/include/customization-apache.rst +++ b/documentation/docs/content/DockerImages/dockerfiles/include/customization-apache.rst @@ -4,6 +4,6 @@ Apache customization This image has two directories for configuration files which will be automatic loaded. For global configuration options the directory ``/opt/docker/etc/httpd/conf.d`` can be used. -For vhost configuration options the directory ``/opt/docker/etc/httpd/vhost.common.conf``can be used. +For vhost configuration options the directory ``/opt/docker/etc/httpd/vhost.common.d`` can be used. Any ``*.conf`` files inside these direcories will be included either global or the vhost section. diff --git a/provisioning/apache/general/bin/service.d/httpd.d/10-init.sh b/provisioning/apache/general/bin/service.d/httpd.d/10-init.sh index b38dec4fa..c3af6cd17 100644 --- a/provisioning/apache/general/bin/service.d/httpd.d/10-init.sh +++ b/provisioning/apache/general/bin/service.d/httpd.d/10-init.sh @@ -15,5 +15,5 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/httpd/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/httpd/conf.d/10-php.conf + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf fi diff --git a/provisioning/apache/general/provision/roles/webdevops-apache/tasks/bootstrap.yml b/provisioning/apache/general/provision/roles/webdevops-apache/tasks/bootstrap.yml index bf82e5d64..7cf851c4b 100644 --- a/provisioning/apache/general/provision/roles/webdevops-apache/tasks/bootstrap.yml +++ b/provisioning/apache/general/provision/roles/webdevops-apache/tasks/bootstrap.yml @@ -2,16 +2,19 @@ - name: Set apache vhost file [RedHat family] set_fact: + apache_main_path: /etc/httpd/ apache_docker_vhost: /etc/httpd/conf.d/docker.conf when: ansible_os_family == 'RedHat' - name: Set apache vhost file [Debian family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/sites-enabled/10-docker.conf when: ansible_os_family == 'Debian' - name: Set apache vhost file [Alpine family] set_fact: + apache_main_path: /etc/apache2/ apache_docker_vhost: /etc/apache2/conf.d/docker.conf when: ansible_os_family == 'Alpine' @@ -41,6 +44,31 @@ recurse: yes when: ansible_os_family == 'Alpine' +- name: Find apache2 files + shell: "find '{{ apache_main_path }}' -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log'" + register: apache2_conf_files + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*CustomLog ([^\s]+)(.*)' + replace: 'CustomLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change CustomLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*ErrorLog ([^\s]+)(.*)' + replace: 'ErrorLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + +- name: Change TransferLog to Docker stdout + replace: + dest: '{{ item }}' + regexp: '^[\s]*TransferLog ([^\s]+)(.*)' + replace: 'TransferLog /docker.stdout \2' + with_items: "{{ apache2_conf_files.stdout_lines }}" + - name: Switch MPM to worker [RedHat family] lineinfile: dest: '/etc/httpd/conf.modules.d/00-mpm.conf' diff --git a/provisioning/base-app/general/bin/service.d/dnsmasq.d/10-init.sh b/provisioning/base-app/general/bin/service.d/dnsmasq.d/10-init.sh index 9ef54af5a..03baba08f 100644 --- a/provisioning/base-app/general/bin/service.d/dnsmasq.d/10-init.sh +++ b/provisioning/base-app/general/bin/service.d/dnsmasq.d/10-init.sh @@ -1,3 +1,6 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + ## clear dns file echo > /etc/dnsmasq.d/webdevops @@ -11,7 +14,19 @@ if [ ! -f /etc/resolv.conf.original ]; then echo "nameserver 127.0.0.1" > /etc/resolv.conf fi + # Add own VIRTUAL_HOST as loopback if [[ -n "${VIRTUAL_HOST+x}" ]]; then - echo "address=/${VIRTUAL_HOST}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops + done fi diff --git a/provisioning/base-app/general/etc/supervisor.d/postfix.conf b/provisioning/base-app/general/etc/supervisor.d/postfix.conf index 7c0a83338..b8d70bb40 100644 --- a/provisioning/base-app/general/etc/supervisor.d/postfix.conf +++ b/provisioning/base-app/general/etc/supervisor.d/postfix.conf @@ -1,5 +1,5 @@ [group:postfix] -programs=postfixd,postfix-log +programs=postfixd priority=30 [program:postfixd] @@ -9,13 +9,6 @@ process_name=%(program_name)s startsecs = 0 autostart = false autorestart = true - -[program:postfix-log] -command = bash /opt/docker/bin/logwatch.sh postfix /var/log/mail.log -process_name=%(program_name)s -startsecs = 0 -autostart = false -autorestart = true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr diff --git a/provisioning/base/alpine/etc/syslog-ng/syslog-ng.conf b/provisioning/base/alpine/etc/syslog-ng/syslog-ng.conf index 0f1638471..adda3e8c5 100644 --- a/provisioning/base/alpine/etc/syslog-ng/syslog-ng.conf +++ b/provisioning/base/alpine/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ -@version: 3.7 +@version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/provisioning/base/general/bin/config.sh b/provisioning/base/general/bin/config.sh index a79efefaa..2ab34037d 100644 --- a/provisioning/base/general/bin/config.sh +++ b/provisioning/base/general/bin/config.sh @@ -125,7 +125,6 @@ function runProvisionBuild() { for FILE in /opt/docker/provision/build.d/*.sh; do # run custom scripts, only once . "$FILE" - rm -f -- "$FILE" done runDockerProvision build diff --git a/provisioning/base/general/bin/entrypoint.sh b/provisioning/base/general/bin/entrypoint.sh index b8a179e38..a33dbec7c 100644 --- a/provisioning/base/general/bin/entrypoint.sh +++ b/provisioning/base/general/bin/entrypoint.sh @@ -8,6 +8,10 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true trap 'echo sigterm ; exit' SIGTERM trap 'echo sigkill ; exit' SIGKILL +# link stdout from docker +ln -f -s "/proc/$$/fd/0" /docker.stdout +chmod 600 /docker.stdout + # sanitize input and set task TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" diff --git a/provisioning/base/general/bin/service.d/syslog-ng.d/10-init.sh b/provisioning/base/general/bin/service.d/syslog-ng.d/10-init.sh index e15eff00b..ee2efa6e1 100644 --- a/provisioning/base/general/bin/service.d/syslog-ng.d/10-init.sh +++ b/provisioning/base/general/bin/service.d/syslog-ng.d/10-init.sh @@ -3,25 +3,3 @@ # then we remove it. if [ ! -S /dev/log ]; then rm -f /dev/log; fi if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi - -SYSLOGNG_OPTS="" - -[ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng - -case "x$CONSOLE_LOG_LEVEL" in - x[1-8]) - dmesg -n $CONSOLE_LOG_LEVEL - ;; - x) - ;; - *) - echo "CONSOLE_LOG_LEVEL is of unaccepted value." - ;; -esac - -if [ ! -e /dev/xconsole ] -then - mknod -m 640 /dev/xconsole p - chown root:adm /dev/xconsole - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE -fi diff --git a/provisioning/base/general/bin/service.d/syslog-ng.sh b/provisioning/base/general/bin/service.d/syslog-ng.sh index 69ae75f46..09d1730ba 100644 --- a/provisioning/base/general/bin/service.d/syslog-ng.sh +++ b/provisioning/base/general/bin/service.d/syslog-ng.sh @@ -5,4 +5,4 @@ source /opt/docker/bin/config.sh includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" -exec syslog-ng -F -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS diff --git a/provisioning/base/general/etc/supervisor.conf b/provisioning/base/general/etc/supervisor.conf index 58094580d..23367a81f 100644 --- a/provisioning/base/general/etc/supervisor.conf +++ b/provisioning/base/general/etc/supervisor.conf @@ -1,5 +1,6 @@ [supervisord] nodaemon=true +logfile = /docker.stdout [unix_http_server] file = /var/run/supervisor.sock diff --git a/provisioning/base/general/etc/supervisor.d/syslog-ng.conf b/provisioning/base/general/etc/supervisor.d/syslog-ng.conf index d7710af57..247fd1a25 100644 --- a/provisioning/base/general/etc/supervisor.d/syslog-ng.conf +++ b/provisioning/base/general/etc/supervisor.d/syslog-ng.conf @@ -11,13 +11,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:syslog-log] -command = /opt/docker/bin/logwatch.sh syslog /var/log/syslog -process_name=%(program_name)s -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/provisioning/base/general/etc/syslog-ng/syslog-ng.conf b/provisioning/base/general/etc/syslog-ng/syslog-ng.conf index c08f56dd1..adda3e8c5 100644 --- a/provisioning/base/general/etc/syslog-ng/syslog-ng.conf +++ b/provisioning/base/general/etc/syslog-ng/syslog-ng.conf @@ -1,146 +1,18 @@ @version: 3.5 -# Syslog-ng configuration file, compatible with default Debian syslogd -# installation. +template t_isostamp { template("[SYSLOG] $MSGHDR$MSG\n"); }; + +options { file-template(t_isostamp); }; -# First, set some global options. options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); owner("root"); group("adm"); perm(0640); stats_freq(0); bad_hostname("^gconfd$"); }; -######################## -# Sources -######################## -# This is the default behavior of sysklogd package -# Logs may come from unix stream, but not from another machine. -# source s_src { unix-stream("/dev/log"); internal(); }; -# If you wish to get logs from remote machine you should uncomment -# this and comment the above source line. -# -#source s_net { tcp(ip(127.0.0.1) port(1000)); }; - -######################## -# Destinations -######################## -# First some standard logfile -# -destination d_auth { file("/var/log/auth.log"); }; -destination d_cron { file("/var/log/cron.log"); }; -destination d_daemon { file("/var/log/daemon.log"); }; -destination d_kern { file("/var/log/kern.log"); }; -destination d_lpr { file("/var/log/lpr.log"); }; -destination d_mail { file("/var/log/mail.log"); }; -destination d_syslog { file("/var/log/syslog"); }; -destination d_user { file("/var/log/user.log"); }; -destination d_uucp { file("/var/log/uucp.log"); }; - -# This files are the log come from the mail subsystem. -# -destination d_mailinfo { file("/var/log/mail.info"); }; -destination d_mailwarn { file("/var/log/mail.warn"); }; -destination d_mailerr { file("/var/log/mail.err"); }; - -# Logging for INN news system -# -destination d_newscrit { file("/var/log/news/news.crit"); }; -destination d_newserr { file("/var/log/news/news.err"); }; -destination d_newsnotice { file("/var/log/news/news.notice"); }; - -# Some 'catch-all' logfiles. -# -destination d_debug { file("/var/log/debug"); }; -destination d_error { file("/var/log/error"); }; -destination d_messages { file("/var/log/messages"); }; - -# The named pipe /dev/xconsole is for the nsole' utility. To use it, -# you must invoke nsole' with the -file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -destination d_xconsole { pipe("/dev/xconsole"); }; - -# Send the messages to an other host -# -#destination d_net { tcp("127.0.0.1" port(1000) log_fifo_size(1000)); }; - -# Debian only -destination d_ppp { file("/var/log/ppp.log"); }; - -######################## -# Filters -######################## -# Here's come the filter options. With this rules, we can set which -# message go where. - -filter f_dbg { level(debug); }; -filter f_info { level(info); }; -filter f_notice { level(notice); }; -filter f_warn { level(warn); }; -filter f_err { level(err); }; -filter f_crit { level(crit .. emerg); }; - -filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; -filter f_error { level(err .. emerg) ; }; -filter f_messages { level(info,notice,warn) and - not facility(auth,authpriv,cron,daemon,mail,news); }; - -filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; -filter f_cron { facility(cron) and not filter(f_debug); }; -filter f_daemon { facility(daemon) and not filter(f_debug); }; -filter f_kern { facility(kern) and not filter(f_debug); }; -filter f_lpr { facility(lpr) and not filter(f_debug); }; -filter f_local { facility(local0, local1, local3, local4, local5, - local6, local7) and not filter(f_debug); }; -filter f_mail { facility(mail) and not filter(f_debug); }; -filter f_news { facility(news) and not filter(f_debug); }; -filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; -filter f_user { facility(user) and not filter(f_debug); }; -filter f_uucp { facility(uucp) and not filter(f_debug); }; - -filter f_cnews { level(notice, err, crit) and facility(news); }; -filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; - -filter f_ppp { facility(local2) and not filter(f_debug); }; -filter f_console { level(warn .. emerg); }; - -######################## -# Log paths -######################## -log { source(s_src); filter(f_auth); destination(d_auth); }; -log { source(s_src); filter(f_cron); destination(d_cron); }; -log { source(s_src); filter(f_daemon); destination(d_daemon); }; -log { source(s_src); filter(f_kern); destination(d_kern); }; -log { source(s_src); filter(f_lpr); destination(d_lpr); }; -log { source(s_src); filter(f_syslog3); destination(d_syslog); }; -log { source(s_src); filter(f_user); destination(d_user); }; -log { source(s_src); filter(f_uucp); destination(d_uucp); }; - -log { source(s_src); filter(f_mail); destination(d_mail); }; -#log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; -#log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; -#log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; - -log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; -log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; -log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; - -#log { source(s_src); filter(f_ppp); destination(d_ppp); }; - -log { source(s_src); filter(f_debug); destination(d_debug); }; -log { source(s_src); filter(f_error); destination(d_error); }; -log { source(s_src); filter(f_messages); destination(d_messages); }; - -# All messages send to a remote site -# -#log { source(s_src); destination(d_net); }; - -### -# Include all config files in /etc/syslog-ng/conf.d/ -### -#@include "/etc/syslog-ng/conf.d/*.conf" +destination d_all { file("/docker.stdout"); }; +log { source(s_src); destination(d_all); }; diff --git a/provisioning/base/general/provision/build.d/10-cleanup.sh b/provisioning/base/general/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..20fbdc841 --- /dev/null +++ b/provisioning/base/general/provision/build.d/10-cleanup.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* diff --git a/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml b/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml index 70593afb7..d87926be2 100644 --- a/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml +++ b/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/logrotate.yml @@ -14,3 +14,20 @@ force: yes with_fileglob: - /opt/docker/etc/logrotate.d/* + +- name: Remove system logrotates (not needed) + file: + path: '{{ item }}' + state: absent + with_items: + # Debian/Ubuntu + - /etc/cron.daily/logrotate + - /etc/cron.daily/apt-compat + - /etc/cron.daily/dpkg + - /etc/cron.daily/passwd + # RedHat + - /etc/cron.daily/0yum-daily.cron + - /etc/cron.daily/logrotate + - /etc/cron.hourly/0yum-hourly.cron + # Alpine + - /etc/periodic/daily/logrotate diff --git a/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml b/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml index c6746f273..27c8f6a30 100644 --- a/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml +++ b/provisioning/base/general/provision/roles/webdevops-base/tasks/bootstrap/syslog-ng.yml @@ -1,5 +1,9 @@ --- +- name: Get syslog-ng version + shell: "syslog-ng --version | grep -E -e '^syslog-ng[ ]+[0-9]+\\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d ." + register: syslogng_version + - name: Configure syslog-ng (default) lineinfile: dest: /etc/default/syslog-ng @@ -9,13 +13,19 @@ with_items: - { key: 'SYSLOGNG_OPTS', value: '--no-caps' } -- name: Enable syslog-n config +- name: Enable syslog-ng config file: src: '/opt/docker/etc/syslog-ng/syslog-ng.conf' dest: '/etc/syslog-ng/syslog-ng.conf' state: link force: yes +- name: Set version of syslog-ng file + lineinfile: + dest: '/etc/syslog-ng/syslog-ng.conf' + regexp: '^@version:' + line: '@version: {{ syslogng_version.stdout }}' + - name: Ensure /var/lib/syslog-ng exists file: path: '/var/lib/syslog-ng' diff --git a/provisioning/nginx/alpine/etc/nginx/nginx.conf b/provisioning/nginx/alpine/etc/nginx/nginx.conf index f5609826d..fc95b39a3 100644 --- a/provisioning/nginx/alpine/etc/nginx/nginx.conf +++ b/provisioning/nginx/alpine/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/provisioning/nginx/centos/etc/nginx/nginx.conf b/provisioning/nginx/centos/etc/nginx/nginx.conf index f5609826d..713a23e88 100644 --- a/provisioning/nginx/centos/etc/nginx/nginx.conf +++ b/provisioning/nginx/centos/etc/nginx/nginx.conf @@ -4,7 +4,7 @@ user nginx; worker_processes auto; -error_log /var/log/nginx/error.log; +error_log /docker.stdout; pid /run/nginx.pid; events { @@ -16,7 +16,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; + access_log /docker.stdout main; sendfile on; tcp_nopush on; diff --git a/provisioning/nginx/general/bin/service.d/nginx.d/10-init.sh b/provisioning/nginx/general/bin/service.d/nginx.d/10-init.sh index 656e19f64..9034f24ce 100644 --- a/provisioning/nginx/general/bin/service.d/nginx.d/10-init.sh +++ b/provisioning/nginx/general/bin/service.d/nginx.d/10-init.sh @@ -4,6 +4,9 @@ if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then echo "" fi +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + # Replace markers find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_INDEX" find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_DOCUMENT_ROOT" @@ -15,6 +18,6 @@ if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "" "$WEB_PHP_SOCKET" else ## WEB_PHP_SOCKET is not set, remove PHP files - rm /opt/docker/etc/nginx/conf.d/10-php.conf - rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf fi diff --git a/provisioning/nginx/general/etc/nginx/vhost.conf b/provisioning/nginx/general/etc/nginx/vhost.conf index 33e10bfce..d07e27094 100644 --- a/provisioning/nginx/general/etc/nginx/vhost.conf +++ b/provisioning/nginx/general/etc/nginx/vhost.conf @@ -4,8 +4,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; @@ -25,8 +25,8 @@ server { server_name _ docker; - access_log /dev/stdout; - error_log /dev/stdout info; + access_log /docker.stdout; + error_log /docker.stdout info; root ""; index ; diff --git a/provisioning/nginx/general/provision/roles/webdevops-nginx/tasks/bootstrap.yml b/provisioning/nginx/general/provision/roles/webdevops-nginx/tasks/bootstrap.yml index ca34d3dd3..d133e7c73 100644 --- a/provisioning/nginx/general/provision/roles/webdevops-nginx/tasks/bootstrap.yml +++ b/provisioning/nginx/general/provision/roles/webdevops-nginx/tasks/bootstrap.yml @@ -8,6 +8,18 @@ with_items: - { key: 'daemon', value: "off" } +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + +- name: Set access_log to stdout + replace: + dest: /etc/nginx/nginx.conf + regexp: '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' + replace: '\1 /docker.stdout \3' + - name: Enable nginx main config file: src: '/opt/docker/etc/nginx/main.conf' @@ -34,6 +46,26 @@ state: directory recurse: yes +- name: Remove old log directory + file: + path: "/var/lib/nginx/logs" + state: absent + +- name: Create log directory + file: + path: "/var/lib/nginx/logs" + state: directory + +- name: Create stdout symlinks + file: + dest: "{{ item }}" + src: "/docker.stdout" + state: link + force: yes + with_items: + - "/var/lib/nginx/logs/access.log" + - "/var/lib/nginx/logs/error.log" + - name: Fix rights of ssl files file: path: "{{ item.path }}" diff --git a/provisioning/php/general/etc/supervisor.d/php-fpm.conf b/provisioning/php/general/etc/supervisor.d/php-fpm.conf index f40531bbc..5781f5b0a 100644 --- a/provisioning/php/general/etc/supervisor.d/php-fpm.conf +++ b/provisioning/php/general/etc/supervisor.d/php-fpm.conf @@ -1,5 +1,5 @@ [group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access +programs=php-fpmd priority=20 [program:php-fpmd] @@ -13,42 +13,3 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php5-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php5-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php5-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php5-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 5a6d616e3..1844de9d8 100644 --- a/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -39,5 +39,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php5-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php5-fpm.pid" } + - { key: 'error_log', value: "/docker.stdout" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index 95354bab5..0d0130ecb 100644 --- a/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/provisioning/php/general/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -71,9 +71,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php5-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php5-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php5-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'user', value: "{{ APPLICATION_USER }}" } - { key: 'group', value: "{{ APPLICATION_GROUP }}" } diff --git a/provisioning/php/php7/etc/supervisor.d/php-fpm.conf b/provisioning/php/php7/etc/supervisor.d/php-fpm.conf deleted file mode 100644 index 5504e92a1..000000000 --- a/provisioning/php/php7/etc/supervisor.d/php-fpm.conf +++ /dev/null @@ -1,54 +0,0 @@ -[group:php-fpm] -programs=php-fpmd,php-fpm-log-fpm,php-fpm-log-slow,php-fpm-log-error,php-fpm-log-access -priority=20 - -[program:php-fpmd] -command = /opt/docker/bin/service.d/php-fpm.sh -process_name=%(program_name)s -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-fpm] -command = bash /opt/docker/bin/logwatch.sh php:fpm /var/log/php7-fpm/fpm.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-slow] -command = bash /opt/docker/bin/logwatch.sh php:slow /var/log/php7-fpm/slow.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-error] -command = bash /opt/docker/bin/logwatch.sh php:error /var/log/php7-fpm/error.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:php-fpm-log-access] -command = bash /opt/docker/bin/logwatch.sh php:access /var/log/php7-fpm/access.log -startsecs = 0 -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml b/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml index 82c7effa6..36143a96f 100644 --- a/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml +++ b/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.main.yml @@ -49,5 +49,5 @@ regexp: '^[\s;]*{{ item.key }}[\s]*=' line: '{{ item.key }} = {{ item.value }}' with_items: - - { key: 'error_log', value: "/var/log/php7-fpm/fpm.log" } - - { key: 'pid', value: "/var/run/php7-fpm.pid" } + - { key: 'error_log', value: "syslog" } + - { key: 'pid', value: "/var/run/php-fpm.pid" } diff --git a/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml b/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml index e4ed521b3..9ea260579 100644 --- a/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml +++ b/provisioning/php/php7/provision/roles/webdevops-php/tasks/bootstrap/php-fpm.pool.yml @@ -72,9 +72,10 @@ with_items: - { key: 'listen', value: "0.0.0.0:9000" } - { key: 'catch_workers_output', value: "yes" } - - { key: 'access.log', value: "/var/log/php7-fpm/access.log" } - - { key: 'slowlog', value: "/var/log/php7-fpm/slow.log" } - - { key: 'php_admin_value[error_log]', value: "/var/log/php7-fpm/error.log" } + - { key: 'access.format', value: '[php-fpm:access] %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%' } + - { key: 'access.log', value: "/docker.stdout" } + - { key: 'slowlog', value: "/docker.stdout" } + - { key: 'php_admin_value[error_log]', value: "/docker.stdout" } - { key: 'php_admin_value[log_errors]', value: "on" } - { key: 'clear_env', value: "no" } - { key: 'user', value: "{{ APPLICATION_USER }}" } diff --git a/provisioning/vsftp/general/etc/supervisor.d/vsftp.conf b/provisioning/vsftp/general/etc/supervisor.d/vsftp.conf index 114305302..4442ea75a 100644 --- a/provisioning/vsftp/general/etc/supervisor.d/vsftp.conf +++ b/provisioning/vsftp/general/etc/supervisor.d/vsftp.conf @@ -1,5 +1,5 @@ [group:vsftp] -programs=vsftpd,vsftp-log +programs=vsftpd priority=20 [program:vsftpd] @@ -10,12 +10,3 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 - -[program:vsftp-log] -command = bash /opt/docker/bin/logwatch.sh vsftp /var/log/vsftpd.log -autostart = true -autorestart = true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 diff --git a/provisioning/vsftp/general/etc/vsftpd/vsftpd.conf b/provisioning/vsftp/general/etc/vsftpd/vsftpd.conf index cd8877986..958f07dfa 100644 --- a/provisioning/vsftp/general/etc/vsftpd/vsftpd.conf +++ b/provisioning/vsftp/general/etc/vsftpd/vsftpd.conf @@ -21,5 +21,5 @@ file_open_mode=0666 local_umask=000 allow_writeable_chroot=YES -vsftpd_log_file=/var/log/vsftpd.log +vsftpd_log_file=/docker.stdout background=NO diff --git a/template/Dockerfile/docker.jinja2 b/template/Dockerfile/docker.jinja2 index 9c8dfd44d..d552de242 100644 --- a/template/Dockerfile/docker.jinja2 +++ b/template/Dockerfile/docker.jinja2 @@ -10,7 +10,7 @@ FROM {{ image }}:{{ tag }} MAINTAINER info@webdevops.io LABEL vendor=WebDevOps.io LABEL io.webdevops.layout=8 -LABEL io.webdevops.version=0.57.1 +LABEL io.webdevops.version=1.1.0 {%- endmacro %} {%- macro add(source, target) -%} diff --git a/template/Dockerfile/images/bootstrap.jinja2 b/template/Dockerfile/images/bootstrap.jinja2 index d9bb61330..9db45ec58 100644 --- a/template/Dockerfile/images/bootstrap.jinja2 +++ b/template/Dockerfile/images/bootstrap.jinja2 @@ -32,7 +32,8 @@ RUN set -x \ && pip install ansible \ && chmod 750 /usr/bin/ansible* \ # Cleanup - && apk del python-dev + && apk del python-dev \ + && find /var/log/ -mindepth 1 -delete {%- endmacro %} @@ -63,7 +64,8 @@ RUN set -x \ && pip install ansible \ && chmod 750 /usr/bin/ansible* \ && yum erase -y python-devel \ - && yum clean all + && yum clean all \ + && find /var/log/ -mindepth 1 -delete {%- endmacro %} @@ -108,7 +110,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete {%- endmacro %} @@ -154,7 +157,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete {%- endmacro %} @@ -198,6 +202,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libssl-dev \ libffi-dev \ && apt-get autoremove -y -f \ - && apt-get clean -y + && apt-get clean -y \ + && find /var/log/ -mindepth 1 -delete {%- endmacro %} diff --git a/tests/serverspec/spec/shared/base/layout.rb b/tests/serverspec/spec/shared/base/layout.rb index 9f577d96a..e476a1c62 100644 --- a/tests/serverspec/spec/shared/base/layout.rb +++ b/tests/serverspec/spec/shared/base/layout.rb @@ -124,4 +124,23 @@ it { should be_executable.by('others') } end end + + ######################### + ## cronjobs which should not exists + ######################### + [ + "/etc/cron.daily/logrotate", + "/etc/cron.daily/apt-compat", + "/etc/cron.daily/dpkg", + "/etc/cron.daily/passwd", + "/etc/cron.daily/0yum-daily.cron", + "/etc/cron.daily/logrotate", + "/etc/cron.hourly/0yum-hourly.cron", + "/etc/periodic/daily/logrotate", + ].each do |file| + describe file("#{file}") do + # Type check + it { should_not be_file } + end + end end