From b708521f739de36653f451e95a1f9c25dc4fbf54 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Mon, 29 Oct 2018 18:12:10 -0400 Subject: [PATCH] Updated README and Dockerfile to build docker image --- README.md | 33 +++++++++++++++++++++++++++++++++ services/cms/Dockerfile | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58f34c6..3d2df31 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ # datasketch-io +## Build docker image + +`docker build -t androiddrew/datasketch:latest -f ./services/cms/Dockerfile ./services/cms` + +To test the build locally on your laptop: + +`docker run -it --name datasketch_cms -e DB_HOST="host.docker.internal" -p 8888:8000 androiddrew/datasketch:latest` + +If using the postgres.app on Mac OS you will need to update both the postgresql.conf and pg_hba.conf files + +/Users//Library/Application Support/Postgres/var-10/postgresql.conf +``` +listen_addresses = '*' +``` + +/Users//Library/Application Support/Postgres/var-10/pg_hba.conf + +``` +# TYPE DATABASE USER ADDRESS METHOD + +# "local" is for Unix domain socket connections only +local all all trust +# IPv4 local connections: +host all all 127.0.0.1/32 trust +# IPv6 local connections: +host all all ::1/128 trust +# Allow replication connections from localhost, by a user with the +# replication privilege. +local replication all trust +host replication all 127.0.0.1/32 trust +host replication all ::1/128 trust +host datasketch datasketch host.docker.internal trust +``` \ No newline at end of file diff --git a/services/cms/Dockerfile b/services/cms/Dockerfile index e1a1887..d99ba7a 100644 --- a/services/cms/Dockerfile +++ b/services/cms/Dockerfile @@ -11,7 +11,7 @@ RUN pip install gunicorn COPY . /code/ WORKDIR /code/ -RUN python manage.py migrate +# RUN python manage.py migrate # removed to garuantee build RUN useradd wagtail RUN chown -R wagtail /code