Commit d5ec70fa authored by MAGIC's avatar MAGIC

initial commit

parents
# ignore everything in the `unobot-data` folder
unobot-data/*
# … but don’t ignore the `unobot-data/modules` folder
!unobot-data/modules/
# … but ignore everything inside that `unobot-data/modules` folder
unobot-data/modules/*
# … but don’t ignore the `unobot-data/modules/used` folder
!unobot-data/modules/used/
# … but ignore everything inside that `unobot-data/modules/used` folder
unobot-data/modules/used/*
# … except the `unobot.py` there
!unobot-data/modules/used/unobot.py
# ignore everything in the `mysql-data` folder
mysql-data/*
# … except the `.keep` there
!mysql-data/.keep
# ignore everything in the `znc-data` folder
znc-data/*
# … but don’t ignore the `znc-data/modules` folder
!znc-data/modules/
# … but ignore everything inside that `znc-data/modules` folder
znc-data/modules/*
# … except the `*.cpp` there
!mysql-data/modules/*.cpp
\ No newline at end of file
[submodule "znc-data/modules"]
path = znc-data/modules
url = https://github.com/ChasedSpade/znc-modules.git
branch = master
FROM alpine:3.7
RUN set -x \
&& apk add --no-cache python \
py-mysqldb \
python-dev \
mysql-dev \
\ No newline at end of file
FROM alpine:3.7
# modperl and modpython are built, but won't be loadable.
# :full image installs perl and python3 again, making these modules loadable.
# musl silently doesn't support AI_ADDRCONFIG yet, and ZNC doesn't support Happy Eyeballs yet.
# Together they cause very slow connection. So for now IPv6 is disabled here.
ARG CONFIGUREFLAGS="--prefix=/opt/znc --enable-cyrus --enable-perl --enable-python --disable-ipv6"
ARG MAKEFLAGS=""
ENV ZNC_VERSION git-2017-12-23
RUN set -x \
&& adduser -S znc \
&& addgroup -S znc \
&& apk add --no-cache --virtual runtime-dependencies \
ca-certificates \
cyrus-sasl \
icu \
su-exec \
tini \
tzdata \
&& apk add --no-cache --virtual build-dependencies \
build-base \
curl \
cyrus-sasl-dev \
gnupg \
icu-dev \
libressl-dev \
perl-dev \
python3-dev \
&& mkdir /znc-src && cd /znc-src \
&& curl -fsSL "https://znc.in/nightly/znc-${ZNC_VERSION}.tar.gz" -o znc.tgz \
&& tar -zxf znc.tgz --strip-components=1 \
&& mkdir build && cd build \
&& ../configure ${CONFIGUREFLAGS} \
&& make $MAKEFLAGS \
&& make install \
&& apk del build-dependencies \
&& cd / && rm -rf /znc-src
RUN set -x \
&& apk add --no-cache \
build-base \
icu-dev \
libressl-dev \
perl \
python3
COPY znc-build/entrypoint.sh /
COPY znc-build/00-try-sh.sh /startup-sequence/
COPY znc-build/01-options.sh /startup-sequence/
COPY znc-build/30-build-modules.sh /startup-sequence/
COPY znc-build/50-chown.sh /startup-sequence/
COPY znc-build/99-launch.sh /startup-sequence/
VOLUME /znc-data
ENTRYPOINT ["/entrypoint.sh"]
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: unobot-db
-- Generation Time: Jan 01, 2018 at 10:13 PM
-- Server version: 10.2.11-MariaDB-10.2.11+maria~jessie
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `unobot`
--
-- --------------------------------------------------------
--
-- Table structure for table `GAME`
--
CREATE TABLE `GAME` (
`WINNER` varchar(200) NOT NULL,
`DURATION` int(11) NOT NULL,
`ID` int(11) NOT NULL,
`SCORE` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `PLAYERS`
--
CREATE TABLE `PLAYERS` (
`NAME` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `RELATION`
--
CREATE TABLE `RELATION` (
`PLAYER` varchar(200) NOT NULL,
`DURATION` int(11) NOT NULL,
`ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `GAME`
--
ALTER TABLE `GAME`
ADD PRIMARY KEY (`DURATION`,`ID`),
ADD UNIQUE KEY `ID` (`ID`);
--
-- Indexes for table `PLAYERS`
--
ALTER TABLE `PLAYERS`
ADD PRIMARY KEY (`NAME`);
--
-- Indexes for table `RELATION`
--
ALTER TABLE `RELATION`
ADD PRIMARY KEY (`PLAYER`,`DURATION`,`ID`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
version: '3.3'
services:
znc:
build:
context: .
dockerfile: Dockerfile.ZNC
restart: always
volumes:
- ./znc-data:/znc-data
ports:
- 8000:8000
unobot:
build:
context: .
dockerfile: Dockerfile.UNOBot
volumes:
- ./unobot-data:/root
working_dir: /root
command: ./jenni
restart: always
phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
- database:database
environment:
- PMA_HOST=database
ports:
- 8888:80
database:
image: mariadb:10
restart: always
volumes:
- ./mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=unobot
- MYSQL_USER=unobot
- MYSQL_PASSWORD=
This diff is collapsed.
# "docker run -ti znc sh" should work, according to
# https://github.com/docker-library/official-images
if [ "${1:0:1}" != '-' ]; then
exec "$@"
fi
# Might be overriden in some later file, when using "FROM znc"
DATADIR="/znc-data"
# Build modules from source.
if [ -d "${DATADIR}/modules" ]; then
cd "${DATADIR}/modules" || exit 11
# Find module sources.
modules=$(find . -name "*.cpp")
if [ -n "$modules" ]; then
# Build modules.
echo "Building modules $modules..."
/opt/znc/bin/znc-buildmod $modules || exit 12
fi
cd /
fi
# Make sure $DATADIR is owned by znc user. This affects ownership of the
# mounted directory on the host machine too.
chown -R znc:znc "$DATADIR" || exit 1
chmod 700 "$DATADIR" || exit 2
# ZNC itself responds to SIGTERM, and reaps its children, but whatever was
# started via *shell module is not guaranteed to reap their children.
# That's why using tini.
exec /sbin/tini -- su-exec znc:znc /opt/znc/bin/znc --foreground --datadir "$DATADIR" "$@"
#!/bin/sh
for f in /startup-sequence/*; do
source "$f" || exit 1
done
Subproject commit 22849c81c5800454c779a0d1c3da2cc995fac08c
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