From 304044a4db0ce5d26d29021fa23b819bb3a4a194 Mon Sep 17 00:00:00 2001 From: Damian Date: Thu, 19 Dec 2024 16:19:26 -0500 Subject: [PATCH] Adding pgadmin --- .gitignore | 1 + docker-compose.debug.yml | 20 ++++++++++++++++++-- docker-compose.yml | 30 +++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index efabe4d..a79b74f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ next-env.d.ts # Serwist public/sw* public/swe-worker* +/pgadmin-data diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml index 3f309a8..5760f9a 100644 --- a/docker-compose.debug.yml +++ b/docker-compose.debug.yml @@ -10,12 +10,13 @@ services: NODE_ENV: development DOMAIN: http://127.0.0.1:3000/ POSTGRES_DB: planner_db - network_mode: "host" env_file: - .env ports: - 3000:3000 - 9229:9229 + networks: + - internal command: sh -c "npm install --silent && npx prisma migrate dev --name init && npx prisma generate && npm run dev " @@ -27,9 +28,24 @@ services: environment: POSTGRES_PASSWORD: example POSTGRES_DB: planner_db - network_mode: "host" + networks: + - internal volumes: - ./postgres:/var/lib/postgresql/data + planner-pgadmin-dev: + image: dpage/pgadmin4 + container_name: planner-pgadmin + restart: always + ports: + - "8888:80" + environment: + PGADMIN_DEFAULT_EMAIL: example@test.com + PGADMIN_DEFAULT_PASSWORD: admin + networks: + - internal + volumes: + - ./pgadmin-data:/var/lib/pgadmin + networks: internal: diff --git a/docker-compose.yml b/docker-compose.yml index af646f5..77ef5d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: - "traefik.enable=true" - "traefik.docker.network=traefik" - "traefik.http.routers.planner.entrypoints=https" - - "traefik.http.routers.planner.rule=Host(`plan.sccs.swarthmore.edu`)" + - "traefik.http.routers.planner.rule=Host(`plan.sccs.swarthmore.edu`) && !PathPrefix(`/pgadmin`)" - "traefik.http.routers.planner.tls=true" - "traefik.http.routers.planner.tls.certresolver=letsEncrypt" - "traefik.http.services.planner.loadbalancer.server.port=3000" @@ -38,6 +38,28 @@ services: networks: - internal + planner-pgadmin: + image: dpage/pgadmin4 + container_name: planner-pgadmin + restart: always + env_file: + - .env + deploy: + labels: + - "traefik.enable=true" + - "traefik.docker.network=traefik" + - "traefik.http.routers.planner_pgadmin.entrypoints=https" + - "traefik.http.routers.planner_pgadmin.rule=Host(`plan.sccs.swarthmore.edu`) && PathPrefix(`/pgadmin`)" + - "traefik.http.routers.planner_pgadmin.tls=true" + - "traefik.http.routers.planner_pgadmin.tls.certresolver=letsEncrypt" + - "traefik.http.services.planner_pgadmin.loadbalancer.server.port=80" + depends_on: + - planner-db + networks: + - internal + volumes: + - planner-pgadmindata:/var/lib/pgadmin + planner-cron: image: registry.sccs.swarthmore.edu/sccs/planner-cron/planner-cron:latest build: @@ -66,3 +88,9 @@ volumes: type: nfs o: "nfsvers=4,addr=130.58.218.26,rw,nolock,soft" device: ":/volumes/scheduler-dbdata" + planner-pgadmindata: + name: planner-pgadmindata + driver_opts: + type: nfs + o: "nfsvers=4,addr=130.58.218.26,rw,nolock,soft" + device: ":/volumes/planner-pgadmindata"