From 5f77a8e1d42377cdd741ae16e4b43033a5cd1164 Mon Sep 17 00:00:00 2001 From: maso Date: Tue, 9 Jul 2024 14:49:07 +0330 Subject: [PATCH] [update] a new docker file --- .github/workflows/publish.yaml | 19 +++++++++++++++++++ Dockerfile | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 Dockerfile diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..aca9beb --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,19 @@ +name: publishpublish +run-name: ${{ github.actor }} build new image +on: [push] +jobs: + publish-postgres-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build the Postgres 13 Docker image + run: | + timetag=(`date +%Y%M%d`) + docker build . --tag ghcr.io/viraweb123/docker-postgres:13.${timetag} --tag ghcr.io/viraweb123/docker-postgres:13 + docker push ghcr.io/viraweb123/docker-postgres:13 + docker push ghcr.io/viraweb123/docker-postgres:13.${timetag} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc437e5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM postgres:13 + +# Install PostGIS +RUN apt-get update \ + && apt-get install -y \ + postgresql-13-postgis-3 \ + postgresql-13-postgis-3-scripts \ + && rm -rf /var/lib/apt/lists/* + +# Create the PostGIS extension +RUN mkdir -p "/docker-entrypoint-initdb.d" \ + && echo "CREATE EXTENSION IF NOT EXISTS postgis;" > /docker-entrypoint-initdb.d/postgis_o125.sql