mirror of
https://github.com/EpicMorg/docker-scripts.git
synced 2024-12-25 06:05:37 +03:00
cleanup
This commit is contained in:
parent
192d2a2090
commit
12d8e423ba
@ -1 +0,0 @@
|
||||
repository: epicmorg/balancer
|
@ -1,3 +0,0 @@
|
||||
.git
|
||||
scripts
|
||||
.idea
|
@ -1,50 +0,0 @@
|
||||
FROM debian:buster
|
||||
MAINTAINER Anatoliy Zimovskiy <stam@epicm.org>
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
#editing sources list
|
||||
RUN rm /etc/apt/sources.list
|
||||
COPY sources.list /etc/apt/sources.list
|
||||
|
||||
COPY locale.gen /etc/locale.gen
|
||||
|
||||
# fix errors
|
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||
|
||||
#installing utils
|
||||
RUN apt-get update && apt-get install -y --allow-unauthenticated ca-certificates gnupg sudo apt-transport-https lsb-release apt-utils locales console-cyrillic wget curl htop mc tmux iftop cmatrix iputils-ping cmatrix-xfont lsof lynx fontconfig smbclient nano
|
||||
|
||||
|
||||
#installing packages
|
||||
RUN gpg --keyserver keyserver.ubuntu.com --recv 7E7A6C592EF35D13
|
||||
RUN gpg --keyserver keyserver.ubuntu.com --recv 24863F0C716B980B
|
||||
RUN wget -qO - http://packages.openmediavault.org/public/archive.key | sudo apt-key add -
|
||||
COPY openmediavault.list /etc/apt/sources.list.d/openmediavault.list
|
||||
RUN apt-get update && apt-get install -y --allow-unauthenticated openmediavault-keyring postfix openmediavault
|
||||
|
||||
|
||||
#After install fixes
|
||||
#RUN localedef en_US.UTF-8 -i en_US -f UTF-8
|
||||
#RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||
#RUN apt update
|
||||
#RUN apt upgrade -y
|
||||
#RUN apt dist-upgrade -y
|
||||
#RUN apt-get clean autoclean
|
||||
#RUN apt-get autoremove -y
|
||||
#RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#final config
|
||||
# We need to make sure rrdcached uses /data for it's data
|
||||
COPY defaults/rrdcached /etc/default
|
||||
|
||||
# Add our startup script last because we don't want changes
|
||||
# to it to require a full container rebuild
|
||||
COPY omv-startup /usr/sbin/omv-startup
|
||||
RUN chmod +x /usr/sbin/omv-startup
|
||||
|
||||
EXPOSE 8080 8443
|
||||
|
||||
VOLUME /data
|
||||
|
||||
ENTRYPOINT /usr/sbin/omv-startup
|
@ -1,4 +0,0 @@
|
||||
all: ovm
|
||||
|
||||
ovm:
|
||||
docker build --compress -t epicmorg/ovm .
|
@ -1,30 +0,0 @@
|
||||
# Compose example
|
||||
|
||||
```yml
|
||||
version: '3.7'
|
||||
services:
|
||||
balancer:
|
||||
image: epicmorg/balancer
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "0.0.0.0:80:80"
|
||||
- "0.0.0.0:443:443"
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime
|
||||
- /etc/timezone:/etc/timezone
|
||||
- /etc/letsencrypt:/etc/letsencrypt
|
||||
- nginx:/etc/nginx
|
||||
- nginx-usr:/usr/share/nginx/html
|
||||
- /var/lib/nginx
|
||||
# extra_hosts:
|
||||
# - "example.com:192.168.0.11"
|
||||
depends_on:
|
||||
- websites
|
||||
tmpfs:
|
||||
- /tmp
|
||||
volumes:
|
||||
nginx:
|
||||
external: true
|
||||
nginx-usr:
|
||||
external: true
|
||||
```
|
@ -1,6 +0,0 @@
|
||||
[nginx]
|
||||
httpPort = '8080';
|
||||
httpsPort = '8443';
|
||||
|
||||
[data]
|
||||
alwaysClear = 'false';
|
@ -1,121 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Config parser code from https://github.com/chilladx/config-parser
|
||||
config_parser () {
|
||||
local iniFile="$1";
|
||||
local tmpFile=$( mktemp /tmp/`basename $iniFile`.XXXXXX );
|
||||
local intLines;
|
||||
local binSED=$( which sed );
|
||||
|
||||
# copy the ini file to the temporary location
|
||||
cp $iniFile $tmpFile;
|
||||
|
||||
# remove tabs or spaces around the =
|
||||
$binSED -i -e 's/[ \t]*=[ \t]*/=/g' $tmpFile;
|
||||
|
||||
# transform section labels into function declaration
|
||||
$binSED -i -e 's/\[\([A-Za-z0-9_]*\)\]/config.section.\1() \{/g' $tmpFile;
|
||||
$binSED -i -e 's/config\.section\./\}\'$'\nconfig\.section\./g' $tmpFile;
|
||||
|
||||
# remove first line
|
||||
$binSED -i -e '1d' $tmpFile;
|
||||
|
||||
# add the last brace
|
||||
echo -e "\n}" >> $tmpFile;
|
||||
|
||||
# now load the file
|
||||
source $tmpFile;
|
||||
|
||||
# clean up
|
||||
rm -f $tmpFile;
|
||||
}
|
||||
|
||||
if [ -e /data/container.ini ]; then
|
||||
config_parser "/data/container.ini"
|
||||
fi
|
||||
|
||||
if [[ "$(type -t config.section.data)" == "function" ]]; then
|
||||
config.section.data
|
||||
fi
|
||||
|
||||
if [ "${alwaysClear}" = "true" ]; then
|
||||
echo Clearing data because config says so...
|
||||
|
||||
rm -Rf /data/etc
|
||||
rm -Rf /data/var
|
||||
fi
|
||||
|
||||
if [ ! -e /data/etc ] || [ ! -e /data/var ]; then
|
||||
FIRST_RUN=true
|
||||
|
||||
if [ ! -e /data/etc ]; then
|
||||
echo Creating initial configuration...
|
||||
|
||||
mkdir -p /data/etc
|
||||
|
||||
mv /etc/openmediavault /data/etc
|
||||
mv /etc/default /data/etc
|
||||
mv /etc/nginx /data/etc
|
||||
fi
|
||||
|
||||
if [ ! -e /data/var ]; then
|
||||
echo Creating persistent data directory...
|
||||
|
||||
mkdir /data/var
|
||||
|
||||
mv /var/log /data/var/log
|
||||
fi
|
||||
else
|
||||
FIRST_RUN=false
|
||||
|
||||
rm -Rf /etc/openmediavault
|
||||
rm -Rf /etc/default
|
||||
rm -Rf /etc/nginx
|
||||
|
||||
rm -Rf /var/log
|
||||
fi
|
||||
|
||||
echo Linking in configuration and data...
|
||||
ln -s /data/etc/openmediavault /etc/openmediavault
|
||||
ln -s /data/etc/default /etc/default
|
||||
ln -s /data/etc/nginx /etc/nginx
|
||||
|
||||
ln -s /data/var/log /var/log
|
||||
|
||||
if [ "${FIRST_RUN}" = "true" ]; then
|
||||
echo Initializing OpenMediaVault...
|
||||
sed 's/OMV_DEBUG_\(.*\)=.*/OMV_DEBUG_\1="yes"/' -i /etc/default/openmediavault
|
||||
omv-initsystem $(find /usr/share/openmediavault/initsystem ! -name '*rootfs' ! -name '*sysctl' -type f -printf "%f\n" | sort | xargs)
|
||||
fi
|
||||
|
||||
if [[ "$(type -t config.section.nginx)" == "function" ]]; then
|
||||
config.section.nginx
|
||||
fi
|
||||
|
||||
if [ ! -z "${httpPort}" ]; then
|
||||
sed -i "s|listen \(.*\):[0-9][0-9]* \(.*\)|listen \1:${httpPort} \2|g" /etc/nginx/sites-available/openmediavault-webgui
|
||||
fi
|
||||
|
||||
if [ ! -z "${httpsPort}" ]; then
|
||||
sed -i "s|listen \(.*\):[0-9][0-9]* \(.*\) ssl \(.*\)|:listen \1:${httpsPort} \2 ssl \3|g" /etc/nginx/sites-available/openmediavault-webgui
|
||||
fi
|
||||
|
||||
SERVICES="motd openmediavault php5-fpm rrdcached rsyslog sudo anacron ntp openmediavault-engined cron postfix nginx collectd rc.local monit"
|
||||
|
||||
for EACH in ${SERVICES}; do
|
||||
/etc/init.d/${EACH} start
|
||||
done
|
||||
|
||||
if [[ -e /data/startup.sh ]]; then
|
||||
/data/startup.sh
|
||||
fi
|
||||
|
||||
if [ -t 0 ]; then
|
||||
/bin/bash
|
||||
else
|
||||
while true; do
|
||||
sleep 1000 & wait $!
|
||||
done
|
||||
fi
|
@ -1,2 +0,0 @@
|
||||
deb http://packages.openmediavault.org/public usul main partner
|
||||
deb http://packages.openmediavault.org/public usul-proposed main
|
Loading…
Reference in New Issue
Block a user