Convert to loccount based stats calculation.
[jackhill/mal.git] / plpgsql / Dockerfile
1 FROM ubuntu:14.04
2
3 RUN apt-get -y update
4 RUN apt-get -y install make cpp python
5
6 RUN apt-get -y install curl
7 RUN useradd -u 1000 -m -s /bin/bash -G sudo postgres
8
9 ENV PG_VERSION=9.4
10 RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
11 echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list && \
12 apt-get update && \
13 DEBIAN_FRONTEND=noninteractive apt-get -y install acl \
14 postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} && \
15 mkdir -p /var/run/postgresql/9.4-main.pg_stat_tmp/ && \
16 chown -R postgres.postgres /var/run/postgresql
17
18 ENV HOME=/var/run/postgresql
19
20 WORKDIR /mal
21
22 # Travis runs as a couple of different users so add them
23 RUN useradd -ou 1001 -m -s /bin/bash -G sudo,postgres travis
24 RUN useradd -ou 2000 -m -s /bin/bash -G sudo,postgres travis2
25
26 # Enable postgres and travis users to sudo for postgres startup
27 RUN echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
28
29 # Allow both travis and postgres user to connect to DB as 'postgres'
30 RUN sed -i 's/peer$/peer map=mal/' /etc/postgresql/9.4/main/pg_hba.conf
31 RUN echo "mal postgres postgres" >> /etc/postgresql/9.4/main/pg_ident.conf
32 RUN echo "mal travis postgres" >> /etc/postgresql/9.4/main/pg_ident.conf
33 RUN echo "mal travis2 postgres" >> /etc/postgresql/9.4/main/pg_ident.conf
34
35 # Add entrypoint.sh which starts postgres then run bash/command
36 ADD entrypoint.sh /entrypoint.sh
37 ENTRYPOINT ["/entrypoint.sh"]