feat: Pgadmin (#112)
* feat: added pgadmi * feat: add pgadmin to nginx config for reverse proxy
This commit is contained in:
parent
8023efae97
commit
119adf53e4
4
dev.env
4
dev.env
|
|
@ -44,3 +44,7 @@ AWS_S3_BUCKET=appflowy
|
||||||
AWS_REGION=us-east-1
|
AWS_REGION=us-east-1
|
||||||
|
|
||||||
RUST_LOG=info
|
RUST_LOG=info
|
||||||
|
|
||||||
|
# PgAdmin
|
||||||
|
PGADMIN_DEFAULT_EMAIL=admin@example.com
|
||||||
|
PGADMIN_DEFAULT_PASSWORD=password
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,18 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./migrations/before:/docker-entrypoint-initdb.d
|
- ./migrations/before:/docker-entrypoint-initdb.d
|
||||||
|
|
||||||
|
pgadmin:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: docker/pgadmin.Dockerfile
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
environment:
|
||||||
|
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||||
|
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||||
|
ports:
|
||||||
|
- 5400:80
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,18 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./migrations/before:/docker-entrypoint-initdb.d
|
- ./migrations/before:/docker-entrypoint-initdb.d
|
||||||
|
|
||||||
|
pgadmin:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: docker/pgadmin.Dockerfile
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
environment:
|
||||||
|
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||||
|
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||||
|
ports:
|
||||||
|
- 5400:80
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
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"]
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/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
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"Servers": {
|
||||||
|
"1": {
|
||||||
|
"Name": "postgres",
|
||||||
|
"Group": "Servers",
|
||||||
|
"Host": "postgres",
|
||||||
|
"Port": 5432,
|
||||||
|
"MaintenanceDB": "postgres",
|
||||||
|
"Username": "postgres"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,12 @@ http {
|
||||||
proxy_pass http://appflowy_cloud:8000;
|
proxy_pass http://appflowy_cloud:8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PgAdmin
|
||||||
|
location /pgadmin/ {
|
||||||
|
proxy_set_header X-Script-Name /pgadmin;
|
||||||
|
proxy_pass http://pgadmin:80/;
|
||||||
|
}
|
||||||
|
|
||||||
# Admin Frontend
|
# Admin Frontend
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://admin_frontend:3000;
|
proxy_pass http://admin_frontend:3000;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue