feat: use volume mounting to set initial servers
This commit is contained in:
parent
9ff3a830d9
commit
99bd0a8689
|
|
@ -22,9 +22,7 @@ services:
|
||||||
- ./migrations/before:/docker-entrypoint-initdb.d
|
- ./migrations/before:/docker-entrypoint-initdb.d
|
||||||
|
|
||||||
pgadmin:
|
pgadmin:
|
||||||
build:
|
image: dpage/pgadmin4
|
||||||
context: .
|
|
||||||
dockerfile: docker/pgadmin.Dockerfile
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -32,6 +30,8 @@ services:
|
||||||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||||
ports:
|
ports:
|
||||||
- 5400:80
|
- 5400:80
|
||||||
|
volumes:
|
||||||
|
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,7 @@ services:
|
||||||
- ./migrations/before:/docker-entrypoint-initdb.d
|
- ./migrations/before:/docker-entrypoint-initdb.d
|
||||||
|
|
||||||
pgadmin:
|
pgadmin:
|
||||||
build:
|
image: dpage/pgadmin4
|
||||||
context: .
|
|
||||||
dockerfile: docker/pgadmin.Dockerfile
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -46,6 +44,8 @@ services:
|
||||||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||||
ports:
|
ports:
|
||||||
- 5400:80
|
- 5400:80
|
||||||
|
volumes:
|
||||||
|
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
|
||||||
|
|
@ -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
|
|
||||||
Loading…
Reference in New Issue