Skip to content

Commit

Permalink
Merge pull request #2 from I-TECH-UW/pmanko-dockerfile-fix
Browse files Browse the repository at this point in the history
Update dockerfile
  • Loading branch information
pmanko authored Nov 7, 2022
2 parents d7e1780 + d456c32 commit 901e24b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
#

FROM adoptopenjdk/openjdk8:latest
FROM ubuntu:trusty

# Install dependencies
RUN apt-get update && \
apt-get install -y git build-essential curl wget software-properties-common
apt-get install -y git build-essential curl wget software-properties-common openjdk-7-jre

# Install dockerize
ENV DOCKERIZE_VERSION v0.2.0
Expand Down
33 changes: 16 additions & 17 deletions cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ set -e

export PGPASSWORD=openxds


if [[ ! -z `psql -h postgresql-openxds -p 5432 -U postgres -lqt | cut -d \| -f 1 | grep -w 'openxds'` ]]; then
echo "# Database OpenXDS exists #"
else
echo "# Init OpenXDS Database #"

psql -h postgresql-openxds -p 5432 -U postgres -c "CREATE USER openxds SUPERUSER PASSWORD 'openxds'"
psql -h postgresql-openxds -p 5432 -U postgres -c "CREATE DATABASE openxds OWNER 'openxds'";
psql -h postgresql-openxds -p 5432 -d openxds -U openxds -f /opt/openxds/misc/create_database_schema_postgres.sql
fi

if [[ ! -z `psql -h postgresql-openxds -p 5432 -U postgres -lqt | cut -d \| -f 1 | grep -w 'log2'` ]]; then
echo "# Database log2 exists #"
else
echo "# Init log2 Database#"
psql -h postgresql-openxds -p 5432 -U openxds -f /opt/openxds/misc/create_database_schema_log2_postgres.sql
fi
# if [[ ! -z `psql -h postgresql-openxds -p 5432 -U postgres -lqt | cut -d \| -f 1 | grep -w 'openxds'` ]]; then
# echo "# Database OpenXDS exists #"
# else
# echo "# Init OpenXDS Database #"

# psql -h postgresql-openxds -p 5432 -U postgres -c "CREATE USER openxds SUPERUSER PASSWORD 'openxds'"
# psql -h postgresql-openxds -p 5432 -U postgres -c "CREATE DATABASE openxds OWNER 'openxds'";
# psql -h postgresql-openxds -p 5432 -d openxds -U openxds -f /opt/openxds/misc/create_database_schema_postgres.sql
# fi

# if [[ ! -z `psql -h postgresql-openxds -p 5432 -U postgres -lqt | cut -d \| -f 1 | grep -w 'log2'` ]]; then
# echo "# Database log2 exists #"
# else
# echo "# Init log2 Database#"
# psql -h postgresql-openxds -p 5432 -U openxds -f /opt/openxds/misc/create_database_schema_log2_postgres.sql
# fi


echo "# Start OpenXDS #"
Expand Down

0 comments on commit 901e24b

Please sign in to comment.