feat: use volume mounting to set initial servers

This commit is contained in:
Fu Zi Xiang 2023-10-12 23:49:45 +08:00
parent 9ff3a830d9
commit 99bd0a8689
No known key found for this signature in database
4 changed files with 6 additions and 27 deletions

View file

@ -22,9 +22,7 @@ services:
- ./migrations/before:/docker-entrypoint-initdb.d
pgadmin:
build:
context: .
dockerfile: docker/pgadmin.Dockerfile
image: dpage/pgadmin4
depends_on:
- postgres
environment:
@ -32,6 +30,8 @@ services:
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
ports:
- 5400:80
volumes:
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json
redis:
image: redis

View file

@ -36,9 +36,7 @@ services:
- ./migrations/before:/docker-entrypoint-initdb.d
pgadmin:
build:
context: .
dockerfile: docker/pgadmin.Dockerfile
image: dpage/pgadmin4
depends_on:
- postgres
environment:
@ -46,6 +44,8 @@ services:
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
ports:
- 5400:80
volumes:
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json
redis:
image: redis

View file

@ -1,11 +0,0 @@
FROM dpage/pgadmin4
COPY ./docker/pgadmin/servers.json /pgadmin4/servers.json
COPY ./docker/pgadmin/custom_entrypoint.sh /custom_entrypoint.sh
USER root
RUN chmod +x /custom_entrypoint.sh
USER pgadmin
ENTRYPOINT ["/custom_entrypoint.sh"]

View file

@ -1,10 +0,0 @@
#!/bin/sh
# Call the original entrypoint
/entrypoint.sh "$@"
# Your additional commands to invoke setup.py (example below, adjust accordingly)
python setup.py --load-servers /path/to/your/servers.json
# Keep container running
tail -f /dev/null