diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000..6177246 --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,42 @@ +name: Push docker images to Dockerhub + +on: + push: + branches: master + tags: + - "v*.*.*" + +jobs: + multi: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set output + id: vars + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push latest Pattern Atlas UI + if: ${{ steps.vars.outputs.tag == 'master' }} + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: patternatlas/pattern-atlas-db:latest + + - name: Build and push version of Pattern Atlas UI + if: ${{ steps.vars.outputs.tag != 'master' }} + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: patternatlas/pattern-atlas-db:${{ steps.vars.outputs.tag }} diff --git a/Dockerfile b/Dockerfile index cd284ee..0bc9ee9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV SUBFOLDER_CONTENT_REPO_BACKUP_FILES "db-backup-files" ENV COPY_CONTENT_REPOSITORY_TARGET_PATH "/var/pattern-atlas/testdata" ENV POSTGRES_PASSWORD postgres ENV POSTGRES_USER postgres -ENV JDBC_DATABASE_PORT 5432 +ENV JDBC_DATABASE_PORT 5060 ENV POSTGRES_DB db # install dependencies (git) @@ -19,7 +19,11 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +EXPOSE 5060 + COPY clone-data-repo.sh clone-data-repo.sh # if ssh key is set, clone data repo with the sql scripts for initalization and start postgres afterwards -CMD chmod 700 clone-data-repo.sh && ./clone-data-repo.sh && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres" +CMD chmod 700 clone-data-repo.sh \ + && ./clone-data-repo.sh \ + && su postgres -c "/usr/local/bin/docker-entrypoint.sh postgres -p ${JDBC_DATABASE_PORT}"