Commit b5a3650b authored by Andreas Müller's avatar Andreas Müller

Initialisierung mit zwei Images

parents
FROM alpine:3.9
RUN apk add --no-cache git python py-curl py-crypto py-openssl py-imaging
RUN git clone https://github.com/pyload/pyload.git /opt/pyload \
&& mkdir -p /pyload/config /pyload/downloads \
&& cd /opt/pyload \
&& git checkout stable \
&& echo "/pyload/config" > /opt/pyload/module/config/configdir
ADD config/ /tmp/config
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME ["/pyload/config", "/pyload/downloads"]
EXPOSE 7227 8000
CMD ["ash", "/entrypoint.sh"]
#!/bin/bash
set -ex
ABSPATH="$(cd "$(dirname "${0}")"; pwd)"
DEVELOPER=registry.am-wd.de
IMAGE=pyload
docker build -t $DEVELOPER/$IMAGE $ABSPATH
docker push $DEVELOPER/$IMAGE
#!/bin/bash
if [ ! -f "/pyload/config/setup.lock" ]; then
mkdir -p /pyload/config
chmod 777 /pyload/config
mv /tmp/config/* /pyload/config/
fi
if [ -f "/pyload/config/pyload.pid" ]; then
rm /pyload/config/pyload.pid
fi
python /opt/pyload/pyLoadCore.py
FROM alpine:3.7
ENV S6_OVERLAY_VERSION=v1.22.1.0 \
GO_DNSMASQ_VERSION=1.0.7 \
SVN_ADMIN_VERSION=stable-1.6.2
RUN apk add --no-cache --update bind-tools curl libcap apache2 apache2-ctl apache2-utils apache2-webdav mod_dav_svn subversion php7 php7-apache2 php7-session php7-json php7-xml && \
curl -sSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz \
| tar xzf - -C / && \
curl -sSL https://github.com/janeczku/go-dnsmasq/releases/download/${GO_DNSMASQ_VERSION}/go-dnsmasq-min_linux-amd64 -o /bin/go-dnsmasq && \
mkdir -p /opt && \
curl -sSL https://github.com/mfreiholz/iF.SVNAdmin/archive/${SVN_ADMIN_VERSION}.tar.gz \
| tar xzf - -C /opt/ && \
chmod +x /bin/go-dnsmasq && \
apk del curl && \
addgroup go-dnsmasq && \
adduser -D -g "" -s /bin/sh -G go-dnsmasq go-dnsmasq && \
setcap CAP_NET_BIND_SERVICE=+eip /bin/go-dnsmasq && \
mkdir -p /run/apache2/ && \
mkdir /home/svn/ && \
mkdir /etc/subversion && \
touch /etc/subversion/passwd && \
mv /opt/iF.SVNAdmin-${SVN_ADMIN_VERSION} /opt/svnadmin && \
rm -r /var/www/localhost/htdocs && \
ln -s /opt/svnadmin /var/www/localhost/htdocs
COPY root /
ADD apache/ /etc/services.d/apache/
ADD subversion/ /etc/services.d/subversion/
ADD svn/global.func.php /opt/svnadmin/classes/util/global.func.php
ADD svn/access-control /etc/subversion/access-control
ADD svn/dav_svn.conf /etc/apache2/conf.d/dav_svn.conf
RUN chmod -R 777 /opt/svnadmin/data && \
chmod -R 777 /etc/subversion/* && \
chmod -R 777 /home/svn && \
chmod 777 /root
WORKDIR /home/svn
EXPOSE 80 443 3690
VOLUME [ "/opt/svnadmin/data", "/home/svn" ]
ENTRYPOINT [ "/init" ]
CMD []
#!/usr/bin/with-contenv sh
# From https://github.com/smebberson/docker-alpine/tree/master/alpine-apache
exec /usr/sbin/apachectl -DFOREGROUND;
\ No newline at end of file
#!/bin/bash
set -ex
ABSPATH="$(cd "$(dirname "${0}")"; pwd)"
DEVELOPER=registry.am-wd.de
IMAGE=svn-server
docker build -t $DEVELOPER/$IMAGE $ABSPATH
docker push $DEVELOPER/$IMAGE
#!/usr/bin/with-contenv sh
# Unless this has already been defined, set it.
if [ -z "$GO_DNSMASQ_LOG_FILE" ]; then
printf "/var/log/go-dnsmasq/go-dnsmasq.log" > /var/run/s6/container_environment/GO_DNSMASQ_LOG_FILE
fi
# Unless this has already been defined, set it.
if [ -z "$GO_DNSMASQ_RUNAS" ]; then
printf "go-dnsmasq" > /var/run/s6/container_environment/GO_DNSMASQ_RUNAS
fi
#!/usr/bin/with-contenv sh
mkdir -p `dirname $GO_DNSMASQ_LOG_FILE`
/etc/resolv.conf false doesntexist,0:1000 0664 0664
\ No newline at end of file
#!/usr/bin/with-contenv sh
s6-setuidgid $GO_DNSMASQ_RUNAS go-dnsmasq --default-resolver --ndots "1" --fwd-ndots "0" --hostsfile=/etc/hosts >> $GO_DNSMASQ_LOG_FILE 2>&1
#!/usr/bin/with-contenv sh
#
# This script will determine the network IP of the container.
#
# Return format should be a single IP address.
#
# Default to using the value of the $HOSTNAME ENV variable.
getent hosts ${1:-$HOSTNAME} | awk '{print $1}'
#!/usr/bin/execlineb -S0
if { s6-test $# -eq 2 }
backtick -in FILENAME {
pipeline { s6-echo "${1}" }
tr "a-z" "A-Z"
}
import -u FILENAME
redirfd -w 1 /var/run/s6/container_environment/${FILENAME}
s6-echo -n -- ${2}
#!/usr/bin/with-contenv sh
# From https://github.com/smebberson/docker-alpine/tree/master/alpine-apache
exec /usr/bin/svnserve -d --foreground -r /home/svn --listen-port 3690;
\ No newline at end of file
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /home/svn
SVNListParentPath On
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/subversion/passwd
AuthzSVNAccessFile /etc/subversion/access-control
Require valid-user
</Location>
<?php
function checkPHPVersion($minimumVersion)
{
return version_compare(PHP_VERSION, $minimumVersion);
}
function exception_handler($exception)
{
echo "<b>Error:</b> ".$exception->getMessage()."<br>";
echo "<pre>".$exception->getTraceAsString()."</pre>";
exit(1);
}
function tr($text, $args=null)
{
global $appTR;
return $appTR->tr($text, $args);
}
////////////////////////////////////////////////////////////////////////
// LOGGING
////////////////////////////////////////////////////////////////////////
function if_log_debug($message)
{
error_log($message);
}
// ------------------------------------------ Global template "print" functions.
function GlobalHeader()
{
include_once("pages/global-header.php");
}
function GlobalFooter()
{
include_once("pages/global-footer.php");
}
function ProcessTemplate($file)
{
include_once("pages/".$file);
}
function AppVersion()
{
global $appEngine;
print($appEngine->getAppVersionString());
}
function SessionUsername()
{
if (isset($_SESSION["svnadmin_username"]))
{
print($_SESSION["svnadmin_username"]);
}
}
function ScriptName()
{
print(currentScriptFileName());
}
function PrintApplicationVersion()
{
global $appEngine;
print($appEngine->getAppVersionString());
}
function PrintSessionUsername()
{
if (isset($_SESSION["svnadmin_username"]))
{
print($_SESSION["svnadmin_username"]);
}
}
function PrintCurrentScriptName()
{
print(currentScriptFileName());
}
// -------------------------------------------------- Global template functions.
function AppEngine()
{
global $appEngine;
return $appEngine;
}
function Translate($text, $args=null)
{
global $appTR;
print($appTR->tr($text, $args));
}
function CurrentLocale()
{
if (isset($_COOKIE["locale"]) && !empty($_COOKIE["locale"]))
{
return $_COOKIE["locale"];
}
return "en_US";
}
function SetValue($varName, $varValue)
{
global $appTemplate;
$appTemplate->addReplacement($varName, $varValue);
}
function GetValue($varName)
{
global $appTemplate;
if (isset($appTemplate->m_replacements[$varName]))
{
$v=$appTemplate->m_replacements[$varName];
if (!empty($v))
{
return $v;
}
}
return NULL;
}
function GetArrayValue($varName)
{
$v=NULL;
if (($v=GetValue($varName)) != NULL)
{
if (is_array($v))
{
return $v;
}
else
{
return array($v);
}
}
return array();
}
function GetStringValue($varName)
{
$v=NULL;
if (($v=GetValue($varName)) != NULL)
{
return $v;
}
return "";
}
function GetIntValue($varName, $base=10)
{
$v=NULL;
if (($v=GetValue($varName)) != NULL)
{
if (is_int($v))
{
return $v;
}
else
{
return intval($v, $base);
}
}
return 0;
}
function GetBoolValue($varName)
{
$v=NULL;
if (($v=GetValue($varName)) != NULL)
{
if (is_bool($v))
{
return $v;
}
else
{
return (boolean)$v;
}
}
return false;
}
function PrintStringValue($varName) { print(GetStringValue($varName)); }
function PrintIntValue($varName) { print(GetIntValue($varName)); }
function PrintBoolValue($varName) { print(GetBoolValue($varName)); }
// ---------------------------------------- Global template condition functions.
function IsUserLoggedIn()
{
global $appEngine;
return $appEngine->checkUserAuthentication(false);
}
function IsViewUpdateable()
{
global $appEngine;
return $appEngine->isViewUpdateable();
}
function IsProviderActive($providerTypeId)
{
global $appEngine;
return $appEngine->isProviderActive($providerTypeId);
}
function HasAccess($module, $action)
{
global $appEngine;
return $appEngine->checkUserAccess($module, $action);
}
function HasAppExceptions()
{
global $appEngine;
$a=$appEngine->getExceptions();
if (!empty($a))
{
return true;
}
return false;
}
function HasAppMessages()
{
global $appEngine;
$a=$appEngine->getMessages();
if (!empty($a))
{
return true;
}
return false;
}
// --------------------------------------------------- Complete html components.
/**
* Prints the HTML code for a input box which filter a defined table.
*
* @param string $tableId The HTML-ID of the table.
* @param int $columnIndex The column index of the content in which is to search.
*/
function HtmlFilterBox($tableId, $columnIndex=0)
{?>
<div class="datatablesearch">
<?php Translate("Filter"); ?>:
<input type="text" class="filterbox" onkeyup="filterDataTable('<?php print($tableId); ?>', <?php print($columnIndex); ?>,this.value);">
</div>
<?php
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment