diff --git a/importing-through-ui/db/init.sh b/importing-through-ui/db/init.sh index f297db5..e804dc2 100644 --- a/importing-through-ui/db/init.sh +++ b/importing-through-ui/db/init.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +echo 'Creating Orbital user`' +psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/orbital-user.sql echo 'Importing data into db $POSTGRES_DB' psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/dump/pagila-schema.sql echo 'Importing schema finished successfully' @@ -9,4 +11,4 @@ echo 'Importing insert-data finished successfully' psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/dump/pagila-data.sql echo 'Importing data finished successfully' -echo 'Data import finished successfully' \ No newline at end of file +echo 'Data import finished successfully' diff --git a/importing-through-ui/docker-compose.yml b/importing-through-ui/docker-compose.yml index 4c0036e..eb8fa7a 100644 --- a/importing-through-ui/docker-compose.yml +++ b/importing-through-ui/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.3" services: orbital: - image: orbitalhq/orbital:${ORBITAL_VERSION:-latest} + image: orbitalhq/orbital:${ORBITAL_VERSION:-next} environment: JAVA_OPTS: >- -Xms256m @@ -13,7 +13,7 @@ services: --vyne.workspace.config-file=/opt/service/workspace/workspace.conf --vyne.db.username=orbital --vyne.db.password=changeme - --vyne.db.host=postgres + --vyne.db.host=pg-pagila ports: - "9022:9022" expose: @@ -21,7 +21,7 @@ services: volumes: - .:/opt/service/workspace depends_on: - - postgres + - pg-pagila deploy: restart_policy: condition: on-failure @@ -30,7 +30,8 @@ services: memory: 2gb pg-pagila: - # Docker image contains the pagila demo db built in + # Docker image contains the pagila demo db built in, + # plus doubles as the orbital db image: ghcr.io/orbitalapi/demos-films-pagila:latest expose: - 5432 @@ -40,10 +41,6 @@ services: POSTGRES_DB: pagila POSTGRES_USER: root POSTGRES_PASSWORD: admin - volumes: - - postgres_data:/var/lib/postgresql/data - ## Mount the db, to initalize the demo script and create the orbital user - - ./db:/docker-entrypoint-initdb.d films-api: image: ghcr.io/orbitalapi/demos-films-ui-importing-listings-api:latest diff --git a/importing-through-ui/docker/pagila-database/Dockerfile b/importing-through-ui/docker/pagila-database/Dockerfile index 93f0f5f..f015196 100644 --- a/importing-through-ui/docker/pagila-database/Dockerfile +++ b/importing-through-ui/docker/pagila-database/Dockerfile @@ -5,7 +5,7 @@ ENV POSTGRES_USER root ENV POSTGRES_PASSWORD admin COPY *.sh /docker-entrypoint-initdb.d/ -COPY *.sql /docker-entrypoint-initdb.d/dump/ +COPY *.sql /docker-entrypoint-initdb.d/ EXPOSE 5432 -CMD ["postgres"] \ No newline at end of file +CMD ["postgres"] diff --git a/importing-through-ui/docker/pagila-database/init.sh b/importing-through-ui/docker/pagila-database/init.sh index f297db5..83a9aef 100644 --- a/importing-through-ui/docker/pagila-database/init.sh +++ b/importing-through-ui/docker/pagila-database/init.sh @@ -1,12 +1,15 @@ #!/bin/bash set -e +ls -ltra /docker-entrypoint-initdb.d/ +#echo 'Creating Orbital user`' +psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/orbital-user.sql echo 'Importing data into db $POSTGRES_DB' -psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/dump/pagila-schema.sql +psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/pagila-schema.sql echo 'Importing schema finished successfully' -psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/dump/pagila-insert-data.sql +psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/pagila-insert-data.sql echo 'Importing insert-data finished successfully' -psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/dump/pagila-data.sql +psql --username $POSTGRES_USER -d $POSTGRES_DB < /docker-entrypoint-initdb.d/pagila-data.sql echo 'Importing data finished successfully' -echo 'Data import finished successfully' \ No newline at end of file +echo 'Data import finished successfully' diff --git a/importing-through-ui/docker/pagila-database/oribtal-user.sql b/importing-through-ui/docker/pagila-database/orbital-user.sql old mode 100644 new mode 100755 similarity index 100% rename from importing-through-ui/docker/pagila-database/oribtal-user.sql rename to importing-through-ui/docker/pagila-database/orbital-user.sql