Started building Docker test environment
This commit is contained in:
parent
9772c52322
commit
c73715bd65
|
@ -0,0 +1,19 @@
|
||||||
|
# TODO: make version variable?
|
||||||
|
FROM postgres:9.6
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
postgresql-server-dev-9.6 \
|
||||||
|
libphonenumber6 \
|
||||||
|
sudo
|
||||||
|
|
||||||
|
CMD ["/data/run-tests.sh"]
|
||||||
|
|
||||||
|
COPY ./ /data/
|
||||||
|
RUN chown -R postgres:postgres /data/
|
||||||
|
|
||||||
|
# Patch the entrypoint script so it always initializes the DB.
|
||||||
|
RUN patch /usr/local/bin/docker-entrypoint.sh < /data/docker-entrypoint.patch
|
||||||
|
|
||||||
|
WORKDIR /data
|
||||||
|
RUN make && make install
|
|
@ -0,0 +1,13 @@
|
||||||
|
32c32,33
|
||||||
|
< if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||||
|
---
|
||||||
|
> #if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||||
|
> if [ "$(id -u)" = '0' ]; then
|
||||||
|
44c45
|
||||||
|
< if [ "$1" = 'postgres' ]; then
|
||||||
|
---
|
||||||
|
> #if [ "$1" = 'postgres' ]; then
|
||||||
|
130c131
|
||||||
|
< fi
|
||||||
|
---
|
||||||
|
> #fi
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
PGDATA=/var/lib/postgresql/data
|
||||||
|
# TODO: don't hard-code version here.
|
||||||
|
pg_ctl=/usr/lib/postgresql/9.6/bin/pg_ctl
|
||||||
|
gosu postgres $pg_ctl "--pgdata=$PGDATA" start -w
|
||||||
|
gosu postgres make installcheck
|
||||||
|
gosu postgres $pg_ctl "--pgdata=$PGDATA" stop
|
||||||
|
|
Loading…
Reference in New Issue