ventriloquist 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +47 -2
- data/Gemfile +2 -1
- data/Gemfile.lock +36 -28
- data/README.md +116 -41
- data/base_box/README.md +3 -0
- data/base_box/Vagrantfile +66 -0
- data/development/Vagrantfile +32 -11
- data/lib/ventriloquist/cap/platforms.rb +55 -0
- data/lib/ventriloquist/cap/{debian → platforms/debian}/elixir_install.rb +1 -0
- data/lib/ventriloquist/cap/{debian → platforms/debian}/erlang_install.rb +0 -0
- data/lib/ventriloquist/cap/{debian → platforms/debian}/go_install.rb +1 -1
- data/lib/ventriloquist/cap/{debian → platforms/debian}/phantomjs_install.rb +1 -1
- data/lib/ventriloquist/cap/{debian → platforms/debian}/python.rb +1 -0
- data/lib/ventriloquist/cap/{linux → platforms/linux}/nvm_install.rb +0 -0
- data/lib/ventriloquist/cap/{linux → platforms/linux}/nvm_install_nodejs.rb +0 -0
- data/lib/ventriloquist/cap/platforms/linux/rvm_install.rb +17 -0
- data/lib/ventriloquist/cap/{linux → platforms/linux}/rvm_install_ruby.rb +2 -3
- data/lib/ventriloquist/cap/services.rb +40 -0
- data/lib/ventriloquist/cap/{debian → services/debian}/mysql_install_client.rb +1 -1
- data/lib/ventriloquist/cap/{debian → services/debian}/mysql_install_headers.rb +1 -1
- data/lib/ventriloquist/cap/{debian → services/debian}/pg_install_client.rb +1 -1
- data/lib/ventriloquist/cap/{debian → services/debian}/pg_install_headers.rb +1 -1
- data/lib/ventriloquist/cap/{debian → services/debian}/ventriloquist_containers_upstart.rb +0 -0
- data/lib/ventriloquist/cap/{linux → services/linux}/mysql_configure_client.rb +0 -0
- data/lib/ventriloquist/cap/{linux → services/linux}/pg_export_pghost.rb +0 -0
- data/lib/ventriloquist/cap/utils.rb +40 -0
- data/lib/ventriloquist/cap/utils/debian/git_install.rb +13 -0
- data/lib/ventriloquist/cap/utils/debian/install_build_tools.rb +13 -0
- data/lib/ventriloquist/cap/utils/debian/install_packages.rb +47 -0
- data/lib/ventriloquist/cap/utils/debian/mercurial_install.rb +13 -0
- data/lib/ventriloquist/cap/utils/linux/download.rb +39 -0
- data/lib/ventriloquist/cap/{linux → utils/linux}/make.rb +0 -0
- data/lib/ventriloquist/cap/{linux → utils/linux}/untar.rb +0 -0
- data/lib/ventriloquist/config.rb +6 -3
- data/lib/ventriloquist/platforms/elixir.rb +1 -1
- data/lib/ventriloquist/platforms/go.rb +1 -1
- data/lib/ventriloquist/platforms/nodejs.rb +1 -0
- data/lib/ventriloquist/platforms/phantomjs.rb +1 -1
- data/lib/ventriloquist/platforms/ruby.rb +1 -0
- data/lib/ventriloquist/plugin.rb +3 -114
- data/lib/ventriloquist/provisioner.rb +12 -1
- data/lib/ventriloquist/service.rb +14 -7
- data/lib/ventriloquist/services/elastic_search.rb +12 -0
- data/lib/ventriloquist/services/mail_catcher.rb +12 -0
- data/lib/ventriloquist/services/memcached.rb +12 -0
- data/lib/ventriloquist/services/mysql.rb +5 -0
- data/lib/ventriloquist/services/postgresql.rb +5 -0
- data/lib/ventriloquist/services/redis.rb +12 -6
- data/lib/ventriloquist/services/rethink_db.rb +16 -0
- data/lib/ventriloquist/services_builder.rb +14 -5
- data/lib/ventriloquist/version.rb +1 -1
- data/locales/en.yml +6 -1
- data/services/base/Dockerfile +8 -7
- data/services/build-all.sh +6 -3
- data/services/elasticsearch/Dockerfile +6 -7
- data/services/mailcatcher/Dockerfile +3 -6
- data/services/memcached/Dockerfile +11 -12
- data/services/mysql/5.5/Dockerfile +17 -0
- data/services/mysql/{config → 5.5/config}/bin/add-mysql-user +0 -5
- data/services/mysql/5.6/Dockerfile +32 -0
- data/services/mysql/5.6/config/bin/add-mysql-user +15 -0
- data/services/mysql/5.6/config/etc/my.cnf +129 -0
- data/services/openjdk7/Dockerfile +1 -5
- data/services/postgresql/9.1/Dockerfile +5 -10
- data/services/postgresql/9.2/Dockerfile +7 -6
- data/services/postgresql/9.3/Dockerfile +16 -0
- data/services/postgresql/9.3/config/bin/prepare-postgres +25 -0
- data/services/postgresql/9.3/config/bin/start-postgres +6 -0
- data/services/postgresql/9.3/config/etc/postgresql/9.3/main/postgresql.conf +591 -0
- data/services/redis/Dockerfile +10 -6
- data/services/rethinkdb/Dockerfile +17 -0
- data/spec/unit/service_spec.rb +22 -12
- data/spec/unit/services_builder_spec.rb +26 -8
- data/ventriloquist.gemspec +1 -1
- metadata +46 -28
- data/lib/ventriloquist/cap/debian/git_install.rb +0 -18
- data/lib/ventriloquist/cap/debian/install_build_tools.rb +0 -18
- data/lib/ventriloquist/cap/debian/mercurial_install.rb +0 -18
- data/lib/ventriloquist/cap/linux/download.rb +0 -26
- data/lib/ventriloquist/cap/linux/rvm_install.rb +0 -17
- data/services/mysql/Dockerfile +0 -20
data/locales/en.yml
CHANGED
data/services/base/Dockerfile
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
# Base image for creating Ventriloquist services
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
4
2
|
|
5
3
|
FROM ubuntu:quantal
|
6
4
|
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
@@ -8,8 +6,11 @@ MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
|
8
6
|
ENV LC_ALL C
|
9
7
|
ENV DEBIAN_FRONTEND noninteractive
|
10
8
|
|
11
|
-
RUN echo "deb http://archive.ubuntu.com/ubuntu quantal main universe" > /etc/apt/sources.list
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
RUN echo "deb http://archive.ubuntu.com/ubuntu quantal main universe" > /etc/apt/sources.list && \
|
10
|
+
apt-get update && \
|
11
|
+
apt-get -y upgrade && \
|
12
|
+
apt-get install -y wget curl vim language-pack-en build-essential software-properties-common && \
|
13
|
+
apt-get autoremove && \
|
14
|
+
apt-get clean && \
|
15
|
+
locale-gen en_US && \
|
16
|
+
echo 'LANG="en_US.UTF-8"' >> /etc/default/locale
|
data/services/build-all.sh
CHANGED
@@ -6,11 +6,14 @@ PREFIX='fgrehm/ventriloquist'
|
|
6
6
|
|
7
7
|
docker build -t ${PREFIX}-base base
|
8
8
|
|
9
|
-
docker build -t ${PREFIX}-pg
|
10
|
-
docker
|
9
|
+
docker build -t ${PREFIX}-pg postgresql/9.3
|
10
|
+
docker build -t ${PREFIX}-pg:9.2 postgresql/9.2
|
11
11
|
docker build -t ${PREFIX}-pg:9.1 postgresql/9.1
|
12
12
|
|
13
|
-
docker build -t ${PREFIX}-mysql mysql
|
13
|
+
docker build -t ${PREFIX}-mysql mysql/5.6
|
14
|
+
docker build -t ${PREFIX}-mysql:5.5 mysql/5.5
|
15
|
+
|
16
|
+
docker build -t ${PREFIX}-rethinkdb rethinkdb
|
14
17
|
|
15
18
|
docker build -t ${PREFIX}-openjdk7 openjdk7
|
16
19
|
docker build -t ${PREFIX}-elasticsearch elasticsearch
|
@@ -1,12 +1,11 @@
|
|
1
|
-
# Elasticsearch
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
1
|
+
# Elasticsearch
|
4
2
|
|
5
3
|
FROM fgrehm/ventriloquist-openjdk7
|
6
|
-
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
7
4
|
|
8
|
-
|
9
|
-
|
5
|
+
RUN wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb -O /tmp/elasticsearch.deb -q --no-check-certificate && \
|
6
|
+
dpkg -i /tmp/elasticsearch.deb && \
|
7
|
+
rm /tmp/elasticsearch.deb && \
|
8
|
+
apt-get clean
|
10
9
|
|
11
|
-
EXPOSE 9200
|
10
|
+
EXPOSE 9200
|
12
11
|
CMD ["/usr/share/elasticsearch/bin/elasticsearch", "-f"]
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# MailCatcher
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
1
|
+
# MailCatcher
|
4
2
|
|
5
3
|
FROM fgrehm/ventriloquist-base
|
6
|
-
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
7
4
|
|
8
5
|
RUN apt-get install -y ruby ruby-dev sqlite3 libsqlite3-dev && apt-get clean
|
9
6
|
RUN gem install mailcatcher --no-ri --no-rdoc
|
10
7
|
|
11
|
-
EXPOSE 1025
|
12
|
-
EXPOSE 1080
|
8
|
+
EXPOSE 1025
|
9
|
+
EXPOSE 1080
|
13
10
|
CMD ["/usr/local/bin/mailcatcher", "-f", "--ip", "0.0.0.0"]
|
@@ -1,17 +1,16 @@
|
|
1
1
|
# Memcached
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
4
2
|
|
5
3
|
FROM fgrehm/ventriloquist-base
|
6
|
-
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
7
4
|
|
8
|
-
|
9
|
-
|
5
|
+
RUN wget -q http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz -O /tmp/memcached.tar.gz && \
|
6
|
+
cd /tmp && \
|
7
|
+
tar xvfz memcached.tar.gz && \
|
8
|
+
cd memcached-1.4.15 && \
|
9
|
+
apt-get install libevent1-dev -y && \
|
10
|
+
./configure --prefix=/usr/local/memcached && \
|
11
|
+
make && \
|
12
|
+
make install && \
|
13
|
+
cd .. && rm -rf memcached* && apt-get clean
|
10
14
|
|
11
|
-
|
12
|
-
|
13
|
-
# allow autostart again
|
14
|
-
RUN rm /usr/sbin/policy-rc.d
|
15
|
-
|
16
|
-
EXPOSE 11211:11211
|
17
|
-
CMD ["/usr/bin/memcached", "-u", "daemon"]
|
15
|
+
EXPOSE 11211
|
16
|
+
CMD ["/usr/local/memcached/bin/memcached", "-u", "daemon"]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# MySQL 5.5
|
2
|
+
|
3
|
+
FROM fgrehm/ventriloquist-base
|
4
|
+
|
5
|
+
# prevent apt from starting mysql right after the installation
|
6
|
+
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d && \
|
7
|
+
apt-get -q -y install mysql-server-5.5 && \
|
8
|
+
apt-get clean && \
|
9
|
+
sed -i 's/127.0.0.1/0.0.0.0/' /etc/mysql/my.cnf && \
|
10
|
+
apt-get clean && \
|
11
|
+
rm /usr/sbin/policy-rc.d # allow autostart again
|
12
|
+
|
13
|
+
ADD config /
|
14
|
+
RUN /bin/add-mysql-user
|
15
|
+
|
16
|
+
EXPOSE 3306
|
17
|
+
CMD ["/usr/sbin/mysqld"]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# MySQL 5.6
|
2
|
+
# Somehow based on http://www.peterchen.net/2013/02/20/en-how-to-install-mysql-5-6-on-ubuntu-12-04-precise/
|
3
|
+
|
4
|
+
FROM fgrehm/ventriloquist-base
|
5
|
+
|
6
|
+
RUN apt-get install libaio-dev -y && \
|
7
|
+
wget -q http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb -O /tmp/mysql.deb && \
|
8
|
+
dpkg -i /tmp/mysql.deb && \
|
9
|
+
rm /tmp/mysql.deb && \
|
10
|
+
groupadd mysql && \
|
11
|
+
useradd -r -g mysql mysql && \
|
12
|
+
mkdir -p /etc/mysql/conf.d && \
|
13
|
+
mkdir -p /var/log/mysql && \
|
14
|
+
mkdir -p /var/run/mysqld && \
|
15
|
+
chown -R mysql:mysql /opt/mysql/server-5.6 && \
|
16
|
+
chown -R mysql:mysql /var/run/mysqld && \
|
17
|
+
/opt/mysql/server-5.6/scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql && \
|
18
|
+
rm /opt/mysql/server-5.6/my*.cnf && \
|
19
|
+
echo 'export PATH="/opt/mysql/server-5.6/bin:$PATH"' > /etc/profile.d/mysql.sh && \
|
20
|
+
apt-get clean && \
|
21
|
+
rm /opt/mysql/server-5.6/bin/mysqld-debug && \
|
22
|
+
rm /opt/mysql/server-5.6/bin/mysqltest_* && \
|
23
|
+
rm /opt/mysql/server-5.6/bin/mysql_client_test* && \
|
24
|
+
rm /opt/mysql/server-5.6/lib/libmysqld-debug.a && \
|
25
|
+
rm -rf /opt/mysql/server-5.6/mysql-test # Save some disk space
|
26
|
+
|
27
|
+
ADD config /
|
28
|
+
|
29
|
+
RUN /bin/add-mysql-user
|
30
|
+
|
31
|
+
EXPOSE 3306
|
32
|
+
CMD ["/opt/mysql/server-5.6/bin/mysqld"]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
user='vagrant'
|
6
|
+
password='vagrant'
|
7
|
+
|
8
|
+
source /etc/profile.d/mysql.sh
|
9
|
+
mysqld& sleep 3
|
10
|
+
|
11
|
+
mysqladmin -u root password $password
|
12
|
+
|
13
|
+
echo "create user '${user}'@'%' identified by '${password}';" | mysql -u root -p$password
|
14
|
+
echo "grant all on *.* to '${user}'@'%' with grant option;" | mysql -u root -p$password
|
15
|
+
echo "FLUSH PRIVILEGES;" | mysql -uroot -p${password}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#
|
2
|
+
# The MySQL database server configuration file.
|
3
|
+
#
|
4
|
+
# You can copy this to one of:
|
5
|
+
# - "/etc/mysql/my.cnf" to set global options,
|
6
|
+
# - "~/.my.cnf" to set user-specific options.
|
7
|
+
#
|
8
|
+
# One can use all long options that the program supports.
|
9
|
+
# Run program with --help to get a list of available options and with
|
10
|
+
# --print-defaults to see which it would actually understand and use.
|
11
|
+
#
|
12
|
+
# For explanations see
|
13
|
+
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
14
|
+
|
15
|
+
# This will be passed to all mysql clients
|
16
|
+
# It has been reported that passwords should be enclosed with ticks/quotes
|
17
|
+
# escpecially if they contain "#" chars...
|
18
|
+
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
|
19
|
+
[client]
|
20
|
+
port = 3306
|
21
|
+
socket = /var/run/mysqld/mysqld.sock
|
22
|
+
|
23
|
+
# Here is entries for some specific programs
|
24
|
+
# The following values assume you have at least 32M ram
|
25
|
+
|
26
|
+
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
|
27
|
+
[mysqld_safe]
|
28
|
+
socket = /var/run/mysqld/mysqld.sock
|
29
|
+
nice = 0
|
30
|
+
|
31
|
+
[mysqld]
|
32
|
+
#
|
33
|
+
# * Basic Settings
|
34
|
+
#
|
35
|
+
user = mysql
|
36
|
+
pid-file = /var/run/mysqld/mysqld.pid
|
37
|
+
socket = /var/run/mysqld/mysqld.sock
|
38
|
+
port = 3306
|
39
|
+
# basedir = /usr
|
40
|
+
basedir = /opt/mysql/server-5.6
|
41
|
+
datadir = /var/lib/mysql
|
42
|
+
tmpdir = /tmp
|
43
|
+
# lc-messages-dir = /usr/share/mysql
|
44
|
+
lc-messages-dir = /opt/mysql/server-5.6/share
|
45
|
+
skip-external-locking
|
46
|
+
#
|
47
|
+
# Instead of skip-networking the default is now to listen only on
|
48
|
+
# localhost which is more compatible and is not less secure.
|
49
|
+
bind-address = 0.0.0.0
|
50
|
+
#
|
51
|
+
# * Fine Tuning
|
52
|
+
#
|
53
|
+
key_buffer = 16M
|
54
|
+
max_allowed_packet = 16M
|
55
|
+
thread_stack = 192K
|
56
|
+
thread_cache_size = 8
|
57
|
+
# This replaces the startup script and checks MyISAM tables if needed
|
58
|
+
# the first time they are touched
|
59
|
+
myisam-recover = BACKUP
|
60
|
+
#max_connections = 100
|
61
|
+
#table_cache = 64
|
62
|
+
#thread_concurrency = 10
|
63
|
+
#
|
64
|
+
# * Query Cache Configuration
|
65
|
+
#
|
66
|
+
query_cache_limit = 1M
|
67
|
+
query_cache_size = 16M
|
68
|
+
#
|
69
|
+
# * Logging and Replication
|
70
|
+
#
|
71
|
+
# Both location gets rotated by the cronjob.
|
72
|
+
# Be aware that this log type is a performance killer.
|
73
|
+
# As of 5.1 you can enable the log at runtime!
|
74
|
+
#general_log_file = /var/log/mysql/mysql.log
|
75
|
+
#general_log = 1
|
76
|
+
#
|
77
|
+
# Error log - should be very few entries.
|
78
|
+
#
|
79
|
+
log_error = /var/log/mysql/error.log
|
80
|
+
#
|
81
|
+
# Here you can see queries with especially long duration
|
82
|
+
#log_slow_queries = /var/log/mysql/mysql-slow.log
|
83
|
+
#long_query_time = 2
|
84
|
+
#log-queries-not-using-indexes
|
85
|
+
#
|
86
|
+
# The following can be used as easy to replay backup logs or for replication.
|
87
|
+
# note: if you are setting up a replication slave, see README.Debian about
|
88
|
+
# other settings you may need to change.
|
89
|
+
#server-id = 1
|
90
|
+
#log_bin = /var/log/mysql/mysql-bin.log
|
91
|
+
expire_logs_days = 10
|
92
|
+
max_binlog_size = 100M
|
93
|
+
#binlog_do_db = include_database_name
|
94
|
+
#binlog_ignore_db = include_database_name
|
95
|
+
#
|
96
|
+
# * InnoDB
|
97
|
+
#
|
98
|
+
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
|
99
|
+
# Read the manual for more InnoDB related options. There are many!
|
100
|
+
#
|
101
|
+
# * Security Features
|
102
|
+
#
|
103
|
+
# Read the manual, too, if you want chroot!
|
104
|
+
# chroot = /var/lib/mysql/
|
105
|
+
#
|
106
|
+
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
|
107
|
+
#
|
108
|
+
# ssl-ca=/etc/mysql/cacert.pem
|
109
|
+
# ssl-cert=/etc/mysql/server-cert.pem
|
110
|
+
# ssl-key=/etc/mysql/server-key.pem
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
[mysqldump]
|
115
|
+
quick
|
116
|
+
quote-names
|
117
|
+
max_allowed_packet = 16M
|
118
|
+
|
119
|
+
[mysql]
|
120
|
+
#no-auto-rehash # faster start of mysql but no tab completition
|
121
|
+
|
122
|
+
[isamchk]
|
123
|
+
key_buffer = 16M
|
124
|
+
|
125
|
+
#
|
126
|
+
# * IMPORTANT: Additional settings that can override those from this file!
|
127
|
+
# The files must end with '.cnf', otherwise they'll be ignored.
|
128
|
+
#
|
129
|
+
!includedir /etc/mysql/conf.d/
|
@@ -1,20 +1,15 @@
|
|
1
1
|
# PostgreSQL 9.1
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
4
2
|
|
5
3
|
FROM fgrehm/ventriloquist-base
|
6
|
-
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
7
4
|
|
8
5
|
# prevent apt from starting postgres right after the installation
|
9
|
-
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
# allow autostart again
|
14
|
-
RUN rm /usr/sbin/policy-rc.d
|
6
|
+
RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d && \
|
7
|
+
apt-get install -y -q postgresql-9.1 postgresql-contrib-9.1 && \
|
8
|
+
apt-get clean && \
|
9
|
+
rm /usr/sbin/policy-rc.d # allow autostart again
|
15
10
|
|
16
11
|
ADD config /
|
17
12
|
RUN /bin/prepare-postgres vagrant vagrant
|
18
13
|
|
19
|
-
EXPOSE 5432
|
14
|
+
EXPOSE 5432
|
20
15
|
CMD ["/bin/start-postgres"]
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# PostgreSQL 9.2
|
2
|
-
#
|
3
|
-
# VERSION 0.0.1
|
4
2
|
|
5
3
|
FROM fgrehm/ventriloquist-base
|
6
|
-
MAINTAINER Fabio Rehm "fgrehm@gmail.com"
|
7
4
|
|
8
|
-
RUN
|
9
|
-
|
5
|
+
RUN wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - && \
|
6
|
+
echo "deb http://apt.postgresql.org/pub/repos/apt precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
|
7
|
+
apt-get update
|
8
|
+
|
9
|
+
RUN apt-get install -y postgresql-9.2 postgresql-contrib-9.2 && \
|
10
|
+
apt-get clean
|
10
11
|
|
11
12
|
ADD config /
|
12
13
|
RUN /bin/prepare-postgres vagrant vagrant
|
13
14
|
|
14
|
-
EXPOSE 5432
|
15
|
+
EXPOSE 5432
|
15
16
|
CMD ["/bin/start-postgres"]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# PostgreSQL 9.3
|
2
|
+
|
3
|
+
FROM fgrehm/ventriloquist-base
|
4
|
+
|
5
|
+
RUN wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - && \
|
6
|
+
echo "deb http://apt.postgresql.org/pub/repos/apt precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
|
7
|
+
apt-get update
|
8
|
+
|
9
|
+
RUN apt-get install -y postgresql-9.3 postgresql-contrib-9.3 && \
|
10
|
+
apt-get clean
|
11
|
+
|
12
|
+
ADD config /
|
13
|
+
RUN /bin/prepare-postgres vagrant vagrant
|
14
|
+
|
15
|
+
EXPOSE 5432
|
16
|
+
CMD ["/bin/start-postgres"]
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
user=$1
|
6
|
+
password=$2
|
7
|
+
|
8
|
+
/etc/init.d/postgresql start
|
9
|
+
|
10
|
+
su postgres -c "createuser --superuser ${user}"
|
11
|
+
su postgres -c "createdb ${user}"
|
12
|
+
su postgres -c "psql -c \"ALTER ROLE ${user} PASSWORD '${password}'\""
|
13
|
+
|
14
|
+
# Based on https://gist.github.com/ffmike/877447
|
15
|
+
su postgres -c "psql postgres -c \"update pg_database set datallowconn = TRUE where datname = 'template0';\""
|
16
|
+
su postgres -c "psql template0 -c \"update pg_database set datistemplate = FALSE where datname = 'template1';\""
|
17
|
+
su postgres -c "psql template0 -c \"drop database template1;\""
|
18
|
+
su postgres -c "psql template0 -c \"create database template1 with template = template0 encoding = 'UTF8';\""
|
19
|
+
su postgres -c "psql template0 -c \"update pg_database set datistemplate = TRUE where datname = 'template1';\""
|
20
|
+
su postgres -c "psql template1 -c \"update pg_database set datallowconn = FALSE where datname = 'template0';\""
|
21
|
+
|
22
|
+
/etc/init.d/postgresql stop
|
23
|
+
|
24
|
+
# Avoid password for local connections
|
25
|
+
echo 'host all all all trust' >> /etc/postgresql/9.3/main/pg_hba.conf
|