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