1- FROM ubuntu:14 .04.3
1+ FROM ubuntu:16 .04
22MAINTAINER Nicola <
[email protected] >, \
3344 Danil Kutkevich <
[email protected] >
55
6- ENV REFRESHED_AT 2015-12-24
6+ ENV REFRESHED_AT 20160425T0900Z
77
88RUN localedef --force --inputfile=en_US --charmap=UTF-8 \
99 --alias-file=/usr/share/locale/locale.alias \
@@ -13,9 +13,9 @@ ENV LANG en_US.UTF-8
1313RUN apt-get --yes update
1414RUN apt-get --yes upgrade
1515
16- # Add PostgreSQL 9.4 apt repository
16+ # Add PostgreSQL (9.1, 9.2, 9.3, 9.4, 9.5) apt repository
1717# <http://www.postgresql.org/download/linux/ubuntu/>.
18- RUN apt-get install --yes curl
18+ RUN apt-get install --yes curl sudo
1919RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' \
2020 > /etc/apt/sources.list.d/pgdg.list
2121RUN curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
@@ -34,12 +34,6 @@ RUN apt-get install --yes postgresql-$PG_MAJOR
3434RUN apt-get install --yes git build-essential libv8-dev postgresql-server-dev-$PG_MAJOR
3535RUN apt-get install --yes nodejs-dev
3636
37- ENV PLV8_BRANCH r1.4
38-
39- RUN cd /tmp && git clone -b $PLV8_BRANCH https://github.com/plv8/plv8.git \
40- && cd /tmp/plv8 \
41- && make all install
42-
4337# Adjust PostgreSQL configuration so that remote connections to the
4438# database are possible.
4539RUN echo 'host all all 0.0.0.0/0 md5' >> /etc/postgresql/$PG_MAJOR/main/pg_hba.conf
@@ -74,36 +68,53 @@ RUN cd ~ \
7468 && git submodule update --init --recursive
7569
7670# Install nodejs.
77- RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0 /install.sh \
71+ RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1 /install.sh \
7872 | bash
79- RUN bash -lc 'source ~/.nvm/nvm.sh && nvm install 5.3 '
80- RUN bash -lc 'cd ~/fhirbase && source ~/.nvm/nvm.sh && nvm use 5.3 \
73+ RUN bash -lc 'source ~/.nvm/nvm.sh && nvm install 6.2.0 '
74+ RUN bash -lc 'cd ~/fhirbase && source ~/.nvm/nvm.sh && nvm use 6.2.0 \
8175 && npm install'
82- RUN bash -lc 'cd ~/fhirbase/plpl && source ~/.nvm/nvm.sh && nvm use 5.3 \
76+ RUN bash -lc 'cd ~/fhirbase/plpl && source ~/.nvm/nvm.sh && nvm use 6.2.0 \
8377 && npm install'
8478
79+ USER root
80+
81+ ENV PLV8_VERSION v1.4.7
82+
83+ RUN cd /tmp \
84+ && git clone https://github.com/plv8/plv8.git \
85+ && cd /tmp/plv8 \
86+ && git checkout $PLV8_VERSION \
87+ && make all install
88+
89+ USER fhirbase
90+
8591# Install fhirbase.
8692RUN bash -lc 'sudo service postgresql start \
8793 && cd ~/fhirbase \
88- && source ~/.nvm/nvm.sh && nvm use 5.3 \
94+ && source ~/.nvm/nvm.sh && nvm use 6.2.0 \
8995 && export PATH="$HOME"/fhirbase/node_modules/coffee-script/bin:"$PATH" \
9096 && export DATABASE_URL=postgres://fhirbase:fhirbase@localhost:5432/fhirbase \
91- && ~/fhirbase/build.sh \
92- && cat ~/fhirbase/tmp /build.sql | psql fhirbase'
97+ && ~/fhirbase/build-commit .sh --rebuild \
98+ && cat ~/fhirbase/build/latest /build.sql | psql fhirbase'
9399
94- # Run test suite.
95- RUN bash -lc 'sudo service postgresql start \
96- && cd ~/fhirbase \
97- && source ~/.nvm/nvm.sh && nvm use 5.3 \
98- && export DATABASE_URL=postgres://fhirbase:fhirbase@localhost:5432/fhirbase \
99- && npm run test'
100+
101+ USER root
102+
103+ COPY docker-run-tests.sh /
104+ RUN chmod a+rwx /docker-run-tests.sh
105+ RUN chown fhirbase /docker-run-tests.sh
106+
107+ # Install utils.
108+ RUN apt-get install --yes openssh-server aptitude
109+
110+ USER fhirbase
100111
101112# Expose the PostgreSQL port.
102113EXPOSE 5432
103114
104115# Add VOLUMEs to allow backup of config, logs, socket and databases
105116VOLUME ['/etc/postgresql', '/var/log/postgresql', '/var/lib/postgresql', '/var/run/postgresql']
106117
107- WORKDIR ~ /fhirbase
118+ WORKDIR /home /fhirbase
108119
109- CMD sudo service postgresql start
120+ CMD /bin/bash
0 commit comments