-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 50e5ea5
Showing
53 changed files
with
1,082 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM debian:wheezy | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG en_US.UTF-8 | ||
|
||
RUN apt-get update -q -o Acquire::Pdiffs=false | ||
RUN apt-get install -qy locales | ||
RUN echo en_US.UTF-8 UTF-8 > /etc/locale.gen | ||
RUN dpkg-reconfigure locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ubuntu:precise | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG en_US.UTF-8 | ||
|
||
RUN apt-get update -q | ||
RUN apt-get install -qy locales | ||
RUN echo en_US.UTF-8 UTF-8 > /etc/locale.gen | ||
RUN dpkg-reconfigure locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM aostanin/debian | ||
|
||
RUN apt-get install -qy mysql-client python3 | ||
|
||
ADD start.py /start.py | ||
|
||
ENTRYPOINT ["/start.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import argparse | ||
import os | ||
import random | ||
import string | ||
import subprocess | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser() | ||
|
||
subparsers = parser.add_subparsers(help="commands") | ||
|
||
parser_add = subparsers.add_parser("add") | ||
parser_add.set_defaults(func=add) | ||
parser_add.add_argument("name", help="name of the database") | ||
parser_add.add_argument("-u", "--username", | ||
help="username (defaults to database name)") | ||
parser_add.add_argument("-p", "--password", | ||
help="password (defaults to a random password)") | ||
|
||
parser_bash = subparsers.add_parser("bash") | ||
parser_bash.set_defaults(func=bash) | ||
|
||
parser_mysql = subparsers.add_parser("mysql") | ||
parser_mysql.set_defaults(func=mysql) | ||
parser_mysql.add_argument("-u", "--username", | ||
help="username (defaults to root)") | ||
parser_mysql.add_argument("-p", "--password", | ||
help="password (defaults root's password from the container)") | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def get_server_details(username=None, password=None): | ||
server = dict() | ||
server["username"] = username or "root" | ||
server["password"] = password | ||
|
||
try: | ||
if server["password"] is None: | ||
with open("/data/.root_password", "r") as f: | ||
server["password"] = f.read().strip() | ||
server["host"] = os.environ["DB_PORT_3306_TCP_ADDR"] | ||
server["port"] = os.environ["DB_PORT_3306_TCP_PORT"] | ||
except IOError: | ||
raise Exception("Root password not found. Did you add the MySQL " | ||
"container's volumes with \"-volumes-from mariadb\"") | ||
except KeyError: | ||
raise Exception("Database server address or port not found. " | ||
"Did you link the MySQL with \"-link mariadb:db\"?") | ||
|
||
return server | ||
|
||
|
||
def add(args): | ||
server = get_server_details() | ||
database = args.name | ||
username = args.username | ||
if username is None: | ||
username = database | ||
password = args.password | ||
if password is None: | ||
password = "".join([random.choice(string.ascii_letters + string.digits) | ||
for n in range(32)]) | ||
|
||
mysql_commands = ( | ||
"CREATE DATABASE `{database}` " | ||
"DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;" | ||
"CREATE USER '{username}'@'%' IDENTIFIED BY '{password}';" | ||
"GRANT ALL PRIVILEGES ON `{database}`.* to '{username}'@'%' " | ||
"WITH GRANT OPTION;" | ||
).format(database=database, username=username, password=password) | ||
|
||
retval = subprocess.call(["mysql", | ||
"--user={0}".format(server["username"]), | ||
"--password={0}".format(server["password"]), | ||
"--host={0}".format(server["host"]), | ||
"--port={0}".format(server["port"]), | ||
"--execute={0}".format(mysql_commands) | ||
]) | ||
|
||
if retval is not 0: | ||
raise Exception("Failed to add database or user. " | ||
"Do they already exist?") | ||
|
||
print("Added new database and user") | ||
print("Database: {database}\nUsername: {username}\nPassword: {password}" | ||
.format(database=database, username=username, password=password)) | ||
|
||
|
||
def bash(args): | ||
subprocess.call("bash") | ||
|
||
|
||
def mysql(args): | ||
server = get_server_details(username=args.username, password=args.password) | ||
subprocess.call(["mysql", | ||
"--user={0}".format(server["username"]), | ||
"--password={0}".format(server["password"]), | ||
"--host={0}".format(server["host"]), | ||
"--port={0}".format(server["port"]) | ||
]) | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
args.func(args) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM aostanin/debian | ||
|
||
RUN echo 'deb http://code.bitlbee.org/debian/devel/wheezy/amd64/ ./' > /etc/apt/sources.list.d/bitlbee.list | ||
ADD bitlbee.key /bitlbee.key | ||
RUN apt-key add /bitlbee.key | ||
RUN apt-get update -q | ||
|
||
RUN apt-get install -qy bitlbee bitlbee-plugin-skype | ||
|
||
ADD start.sh /start.sh | ||
|
||
VOLUME ["/data"] | ||
EXPOSE 6667 | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
Version: GnuPG v1.4.10 (GNU/Linux) | ||
|
||
mQGiBEv++B4RBACR8PCXpBRByIPMY2DxbqUP8LfVNRfgg7X2P4Z0e+zeYHujB0hJ | ||
P6vOW/QmeYSuDzFVH3oOJsC+kaTExf2Rl0/Bm3X4GRkw6XJME/3HR7P0rNCCvqgD | ||
QYOlhmP4qYEi0z6q9WslhqeYzilB/opsQTR/11zUjw5TGp1P/4rcCa0/6wCg87c/ | ||
BOP6XR64zQBD5rBcCzNeL0cD/iFE97JFAYIRHOiYjpgq0/pZ/PoMrULpiyq6+BPo | ||
8YdcuRYdFYDC5Ghmmk0VDIf5knDdsSIA5+tJTHTiKpuHZ7JKx3aJ/HzuAHlG3RaV | ||
eLTl0HvkxWis/ORsjyvztlVtbHy0vVVRaWriVq76MicpdIqY1tcRvmm38j7X+Ois | ||
mcO1A/wNYgJyr0pHvj52T2iosKUHu2TFqVf9sWV0n+kFI1g/aG4oHWbevcrsnbtW | ||
+3t80BNbWAA5zlN6Bdv1MRrFJzogyJK5ao1/Y2uF4wvD64EEKgA91riHKnOSuKo2 | ||
wCccja/CqLovaAN6dvNQ5OapuH+xuc+4IsPxPNCOUQ4TL0V6vbQ9Qml0bEJlZSBu | ||
aWdodGx5IGJ1aWxkcyAuZGVicyBzaWduaW5nIGtleSA8YnVpbGRkQGJpdGxiZWUu | ||
b3JnPohgBBMRAgAgAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AFAk/B55cACgkQ | ||
lO6h8sflBDZMOgCfc+ayGdn90HWe8hDm+xiUcjnQgeEAn1Y0iF3Tu9a+kcPq1L83 | ||
4Izk4INeiEYEEBECAAYFAkv++0YACgkQeYWXmuMwQFExdQCdHbhFwQJ44HUdjxPZ | ||
lPOt3iH9MZ8AoKm88QvS4dCuYmMt9KZ6oDKyCD5l | ||
=LQ+N | ||
-----END PGP PUBLIC KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
mkdir -p /data/users | ||
|
||
if [ ! -f /data/bitlbee/bitlbee.conf ]; then | ||
cp -r /etc/bitlbee /data/bitlbee | ||
fi | ||
|
||
chown -R bitlbee:bitlbee /data | ||
|
||
bitlbee -n -v -D -c /data/bitlbee/bitlbee.conf -d /data/users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM aostanin/debian | ||
|
||
ADD http://download-lb.utorrent.com/endpoint/btsync/os/linux-glibc23-x64/track/stable /btsync.tar.gz | ||
RUN tar xvzf /btsync.tar.gz && rm /btsync.tar.gz | ||
|
||
ADD start.sh /start.sh | ||
ADD btsync.conf /btsync.conf | ||
|
||
VOLUME ["/data"] | ||
VOLUME ["/sync"] | ||
EXPOSE 3369 | ||
EXPOSE 3369/udp | ||
EXPOSE 8888 | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"storage_path" : "/data", | ||
"listening_port" : 3369, | ||
"use_upnp" : false, | ||
"webui" : | ||
{ | ||
"listen" : "0.0.0.0:8888" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
mkdir -p /data | ||
|
||
if [ ! -f /data/btsync.conf ]; then | ||
cp /btsync.conf /data/btsync.conf | ||
fi | ||
|
||
/btsync --nodaemon --config /data/btsync.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM aostanin/debian | ||
|
||
RUN apt-get install -qy git-core python2.7 | ||
RUN git clone https://github.com/RuudBurger/CouchPotatoServer.git /couchpotato | ||
|
||
ADD start.sh /start.sh | ||
|
||
VOLUME ["/data"] | ||
# Torrent watch directory | ||
VOLUME ["/torrents"] | ||
# Incoming downloads | ||
VOLUME ["/downloads"] | ||
# Movie library | ||
VOLUME ["/movies"] | ||
EXPOSE 5050 | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
(cd /couchpotato && git pull) | ||
python2.7 /couchpotato/CouchPotato.py --daemon --console_log --data_dir=/data --config_file=/data/couchpotato.ini | ||
tail -f /data/logs/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM aostanin/debian | ||
|
||
RUN echo 'deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main' > /etc/apt/sources.list.d/deluge.list | ||
RUN apt-key adv --recv-keys --keyserver pgp.surfnet.nl 249AD24C | ||
RUN apt-get update -q | ||
|
||
RUN apt-get install -t precise -qy deluged deluge-web | ||
|
||
ADD start.sh /start.sh | ||
|
||
VOLUME ["/data"] | ||
VOLUME ["/downloads"] | ||
# Torrent port | ||
EXPOSE 53160 | ||
EXPOSE 53160/udp | ||
# WebUI | ||
EXPOSE 8112 | ||
# Daemon | ||
EXPOSE 58846 | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
rm -f /data/deluged.pid | ||
|
||
deluged -c /data -L info -l /data/deluged.log | ||
deluge-web -c /data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM aostanin/ubuntu | ||
|
||
RUN echo 'deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu precise main' > /etc/apt/sources.list.d/nodejs.list | ||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C7917B12 | ||
RUN apt-get update -q | ||
|
||
RUN apt-get install -qy nodejs unzip | ||
|
||
ADD https://ghost.org/zip/ghost-0.4.1.zip /tmp/ghost.zip | ||
RUN unzip -q /tmp/ghost.zip -d /ghost && rm /tmp/ghost.zip | ||
RUN sed -i "s/host:\s*'127.0.0.1'/host: '0.0.0.0'/" /ghost/config.example.js | ||
RUN cd /ghost && npm install --production | ||
|
||
ADD start.sh /start.sh | ||
|
||
VOLUME ["/data"] | ||
EXPOSE 2368 | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
mkdir -p /data | ||
|
||
if [ ! -f /data/config.js ]; then | ||
cp /ghost/config.example.js /data/config.js | ||
fi | ||
|
||
if [ ! -d /content.default ]; then | ||
mv /ghost/content /content.default | ||
fi | ||
|
||
if [ ! -d /data/content ]; then | ||
cp -r /content.default /data/content | ||
fi | ||
|
||
ln -sf /data/content /ghost/content | ||
ln -sf /data/config.js /ghost/config.js | ||
|
||
cd /ghost && npm start --production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM aostanin/debian | ||
|
||
RUN apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate | ||
RUN apt-get install -y python2.7 python-docutils git-core sudo libmysqlclient-dev nginx mysql-client | ||
|
||
ADD http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.bz2 /tmp/ruby.tar.bz2 | ||
RUN cd /tmp && \ | ||
tar xjvf ruby.tar.bz2 && \ | ||
cd ruby-2.0.0-p353 && \ | ||
./configure --disable-install-rdoc && \ | ||
make && \ | ||
make install && \ | ||
cd && \ | ||
rm -rf /tmp/ruby-2.0.0-p353 | ||
RUN gem install bundler --no-ri --no-rdoc | ||
|
||
RUN adduser --disabled-login --gecos 'GitLab' git | ||
|
||
RUN cd /home/git && \ | ||
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.8.0 | ||
|
||
RUN cd /home/git && \ | ||
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-6-stable gitlab && \ | ||
cd gitlab && \ | ||
chown -R git log tmp && \ | ||
sudo -u git -H mkdir /home/git/gitlab-satellites tmp/pids tmp/sockets public/uploads && \ | ||
chmod -R u+rwX log tmp public/uploads && \ | ||
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb && \ | ||
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb && \ | ||
sudo -u git -H git config --global user.name "GitLab" && \ | ||
sudo -u git -H git config --global user.email "gitlab@localhost" && \ | ||
sudo -u git -H git config --global core.autocrlf input && \ | ||
cp lib/support/init.d/gitlab /etc/init.d/gitlab && \ | ||
cp lib/support/init.d/gitlab.default.example /etc/default/gitlab && \ | ||
cp lib/support/nginx/gitlab /etc/nginx/sites-available/default | ||
|
||
RUN cd /home/git/gitlab && \ | ||
sudo -u git -H bundle install --deployment --without development test postgres aws | ||
|
||
ADD start.sh /start.sh | ||
|
||
VOLUME ["/data"] | ||
VOLUME ["/repositories"] | ||
EXPOSE 80 | ||
EXPOSE 22 | ||
|
||
WORKDIR /home/git/gitlab | ||
CMD ["/start.sh"] |
Oops, something went wrong.