From 1c546f8d056e6cc3d7444ea006bf7b4fe51b619f Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sun, 6 May 2018 11:41:40 +0100 Subject: [PATCH] Nai --- dev/Dockerfile | 7 ------- dev/run-internal.sh | 6 ++++++ dev/worker/Dockerfile | 4 ++++ dev/worker/create-container.sh | 3 +++ dev/worker/run-container.sh | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 dev/worker/Dockerfile create mode 100755 dev/worker/create-container.sh create mode 100755 dev/worker/run-container.sh diff --git a/dev/Dockerfile b/dev/Dockerfile index 73f66d6..457d2bc 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -15,12 +15,5 @@ RUN ln -s /data/dev/apache-local.conf /etc/apache2/sites-enabled/ RUN sed -i "s#data_directory = '.*'#data_directory = '/data/run/postgres'#" /etc/postgresql/10/main/postgresql.conf RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/10/main/pg_hba.conf RUN echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf -RUN /etc/init.d/postgresql restart - -RUN sudo -u postgres psql -c "CREATE USER hoou WITH PASSWORD 'hoohoohoo123';" -RUN sudo -u postgres psql -c "CREATE DATABASE hoou;" -RUN sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE hoou to hoou;" - -# psql -h localhost -U hoou hoou # should work CMD /data/dev/run-internal.sh diff --git a/dev/run-internal.sh b/dev/run-internal.sh index 688003e..3bf8612 100755 --- a/dev/run-internal.sh +++ b/dev/run-internal.sh @@ -13,6 +13,12 @@ export PLATFORM_PATH=/data/src V="/data/run/virtualenv" if [[ ! -e $V ]] ; then + sudo -u postgres psql -c "CREATE USER hoou WITH PASSWORD 'hoohoohoo123';" + sudo -u postgres psql -c "CREATE DATABASE hoou;" + sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE hoou to hoou;" + + # psql -h localhost -U hoou hoou # should work + mkdir -p $V virtualenv -p python3 $V cd $V diff --git a/dev/worker/Dockerfile b/dev/worker/Dockerfile new file mode 100644 index 0000000..fc9ccd4 --- /dev/null +++ b/dev/worker/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:18.04 + +WORKDIR /data + diff --git a/dev/worker/create-container.sh b/dev/worker/create-container.sh new file mode 100755 index 0000000..30baf16 --- /dev/null +++ b/dev/worker/create-container.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build -t kunkel/oer-worker . diff --git a/dev/worker/run-container.sh b/dev/worker/run-container.sh new file mode 100755 index 0000000..a796469 --- /dev/null +++ b/dev/worker/run-container.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run -h oer-worker -it --rm -v $PWD/../:/data/ kunkel/oer-worker /bin/bash