Skip to content

Commit

Permalink
fix docker compose for importing-through-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
martypitt committed Sep 2, 2024
1 parent 126ea94 commit 72165fb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion importing-through-ui/db/init.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'
echo 'Data import finished successfully'
13 changes: 5 additions & 8 deletions importing-through-ui/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,15 +13,15 @@ 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:
- 9022
volumes:
- .:/opt/service/workspace
depends_on:
- postgres
- pg-pagila
deploy:
restart_policy:
condition: on-failure
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions importing-through-ui/docker/pagila-database/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
CMD ["postgres"]
11 changes: 7 additions & 4 deletions importing-through-ui/docker/pagila-database/init.sh
Original file line number Diff line number Diff line change
@@ -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'
echo 'Data import finished successfully'
File renamed without changes.

0 comments on commit 72165fb

Please sign in to comment.