Skip to content

Commit 3e2230b

Browse files
committed
Trying to make postgres container PaaS compatible
1 parent 8f241c7 commit 3e2230b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

deploy/postgres.Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM postgres:15
2+
3+
COPY deploy/postgres-init.sql /docker-entrypoint-initdb.d/init.sql
4+
COPY deploy/postgres-entrypoint.sh /usr/local/bin/custom-entrypoint.sh
5+
RUN chmod +x /usr/local/bin/custom-entrypoint.sh
6+
7+
ENTRYPOINT ["/usr/local/bin/custom-entrypoint.sh"]
8+
CMD ["postgres"]

docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ x-common-environment: &common-environment
2525

2626
services:
2727
postgres:
28-
image: postgres:15
28+
build:
29+
context: .
30+
dockerfile: deploy/postgres.Dockerfile
2931
restart: unless-stopped
3032
volumes:
3133
- postgres_data:/var/lib/postgresql
32-
- ./deploy/postgres-init.sql:/docker-entrypoint-initdb.d/init.sql:ro
33-
- ./deploy/postgres-entrypoint.sh:/usr/local/bin/custom-entrypoint.sh:ro
3434
ports:
3535
- "${POSTGRES_EXT_PORT:-}:5432"
36-
entrypoint: [ "/bin/sh", "-c", "/usr/local/bin/custom-entrypoint.sh" ]
3736

3837
server:
3938
restart: unless-stopped

0 commit comments

Comments
 (0)