Skip to content

Commit

Permalink
Adding pgadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
DCRepublic committed Dec 19, 2024
1 parent f1a9f59 commit 304044a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ next-env.d.ts
# Serwist
public/sw*
public/swe-worker*
/pgadmin-data
20 changes: 18 additions & 2 deletions docker-compose.debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "

Expand All @@ -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: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
networks:
- internal
volumes:
- ./pgadmin-data:/var/lib/pgadmin

networks:
internal:
30 changes: 29 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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"

0 comments on commit 304044a

Please sign in to comment.