[#8128] docker file for git over http
Project: http://git-wip-us.apache.org/repos/asf/allura/repo Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/3b8a2736 Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3b8a2736 Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3b8a2736 Branch: refs/heads/db/8128 Commit: 3b8a27364c1860dbc64e4baac05be1412b3f0d94 Parents: fd18061 Author: Dave Brondsema <d...@brondsema.net> Authored: Mon Sep 19 18:28:17 2016 -0400 Committer: Dave Brondsema <d...@brondsema.net> Committed: Mon Sep 19 18:29:25 2016 -0400 ---------------------------------------------------------------------- docker-compose.yml | 11 +++++++++ scm_config/git/Dockerfile | 50 +++++++++++++++++++++++++++++++++++++++ scm_config/git/http-git.conf | 50 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/allura/blob/3b8a2736/docker-compose.yml ---------------------------------------------------------------------- diff --git a/docker-compose.yml b/docker-compose.yml index 22c9a38..31ad916 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,3 +74,14 @@ inmail: - "8825:8825" links: - mongo + +git: + build: scm_config/git/ + ports: + - "8081:80" + #environment: *env + volumes_from: + - web + links: + - mongo + - web \ No newline at end of file http://git-wip-us.apache.org/repos/asf/allura/blob/3b8a2736/scm_config/git/Dockerfile ---------------------------------------------------------------------- diff --git a/scm_config/git/Dockerfile b/scm_config/git/Dockerfile new file mode 100644 index 0000000..3675dc4 --- /dev/null +++ b/scm_config/git/Dockerfile @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +# loosely inspired by https://github.com/jacksoncage/apache-docker/blob/ubuntu/Dockerfile +# not inspired by https://hub.docker.com/_/httpd/ which does a custom source-based install of httpd + +# match main allura Dockerfile, for shared base +FROM ubuntu:14.04 + +# WARNING: Image for service git was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. + +RUN apt-get update && apt-get install -y \ + apache2 \ + libapache2-mod-python \ + git + + +ENV APACHE_RUN_USER www-data +ENV APACHE_RUN_GROUP www-data +ENV APACHE_LOG_DIR /var/log/apache2 +ENV APACHE_PID_FILE /var/run/apache2.pid +ENV APACHE_RUN_DIR /var/run/apache2 +ENV APACHE_LOCK_DIR /var/lock/apache2 +ENV APACHE_SERVERADMIN admin@localhost +ENV APACHE_SERVERNAME localhost +ENV APACHE_SERVERALIAS docker.localhost +ENV APACHE_DOCUMENTROOT /var/www + +ADD ./http-git.conf /etc/apache2/sites-available/ +RUN a2dissite 000-default.conf +RUN a2ensite http-git.conf + +RUN a2enmod cgi + +CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/allura/blob/3b8a2736/scm_config/git/http-git.conf ---------------------------------------------------------------------- diff --git a/scm_config/git/http-git.conf b/scm_config/git/http-git.conf new file mode 100644 index 0000000..1707014 --- /dev/null +++ b/scm_config/git/http-git.conf @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ErrorLog /dev/stderr + +<VirtualHost *:80> + + SetEnv GIT_PROJECT_ROOT /allura-data/scm/git + SetEnv GIT_HTTP_EXPORT_ALL + ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ + + # disable access to default web content + <Directory /var/www> + Order Deny,Allow + Deny from all + Options None + AllowOverride None + </Directory> + + <Location "/git/"> + Require all granted + + AddHandler mod_python .py + PythonAccessHandler /allura/scripts/ApacheAccessHandler.py + PythonDebug On + + AuthType Basic + AuthName "Git Access" + AuthBasicAuthoritative off + PythonOption ALLURA_PERM_URL http://web:8080/auth/repo_permissions + PythonOption ALLURA_AUTH_URL http://web:8080/auth/do_login + # for 'requests' lib only + PythonOption ALLURA_VIRTUALENV /allura-data/virtualenv + </Location> + +</VirtualHost> \ No newline at end of file