Skip to content

Commit e088e37

Browse files
committed
initial commit
0 parents  commit e088e37

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#######################################################
2+
# PostgreSQL database instance. Supports the Rolltime
3+
# collector and forecasting services.
4+
#######################################################
5+
6+
FROM ubuntu:14.04
7+
8+
#
9+
# Fetch PostgreSQL PGP key.
10+
#
11+
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
12+
13+
#
14+
# Add official PostgreSQL repo.
15+
#
16+
RUN \
17+
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
18+
19+
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
20+
# There are some warnings (in red) that show up during the build. You can hide
21+
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
22+
RUN \
23+
apt-get update \
24+
&& apt-get install -y python-software-properties software-properties-common \
25+
postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
26+
27+
#
28+
# The rest of the commands have
29+
# to be run as the `postgres` user
30+
# for default security reasons.
31+
#
32+
USER postgres
33+
34+
#
35+
# Create Rolltime db user with password.
36+
#
37+
RUN /etc/init.d/postgresql start \
38+
&& psql --command "CREATE USER rolltime WITH SUPERUSER PASSWORD 'rolltime';" \
39+
&& createdb -O docker docker
40+
41+
#
42+
# Allow remote connections.
43+
#
44+
RUN \
45+
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf \
46+
&& echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
47+
48+
EXPOSE 5432
49+
50+
#
51+
# Volumes for configuration files, logs,
52+
# and databases to be mapped to host.
53+
#
54+
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
55+
56+
#
57+
# Starts database.
58+
#
59+
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2015 Luis Capelo <luiscape@gmail.com>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Rolltime PostgreSQL
2+
Instance that supports data collection for the Rolltime family of applications.
3+
4+
## Docker Usage
5+
This service is designed to run as a Docker image. Build the image from the `Dockerfile` and run it mounting its instructed volumes locally with:
6+
7+
```shell
8+
$ docker run --rm --volumes-from [CONTAINER_ID]
9+
```

0 commit comments

Comments
 (0)