Skip to content

Commit 5f77a8e

Browse files
[update] a new docker file
1 parent 54c606e commit 5f77a8e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/publish.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: publishpublish
2+
run-name: ${{ github.actor }} build new image
3+
on: [push]
4+
jobs:
5+
publish-postgres-image:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: docker/login-action@v1
10+
with:
11+
registry: ghcr.io
12+
username: ${{ github.actor }}
13+
password: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Build the Postgres 13 Docker image
15+
run: |
16+
timetag=(`date +%Y%M%d`)
17+
docker build . --tag ghcr.io/viraweb123/docker-postgres:13.${timetag} --tag ghcr.io/viraweb123/docker-postgres:13
18+
docker push ghcr.io/viraweb123/docker-postgres:13
19+
docker push ghcr.io/viraweb123/docker-postgres:13.${timetag}

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM postgres:13
2+
3+
# Install PostGIS
4+
RUN apt-get update \
5+
&& apt-get install -y \
6+
postgresql-13-postgis-3 \
7+
postgresql-13-postgis-3-scripts \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Create the PostGIS extension
11+
RUN mkdir -p "/docker-entrypoint-initdb.d" \
12+
&& echo "CREATE EXTENSION IF NOT EXISTS postgis;" > /docker-entrypoint-initdb.d/postgis_o125.sql

0 commit comments

Comments
 (0)