Skip to content

Commit 37a6e35

Browse files
authored
✨ Migrate from pgAdmin to Adminer (#692)
1 parent 237c5a3 commit 37a6e35

10 files changed

Lines changed: 19 additions & 47 deletions

File tree

.env

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ POSTGRES_DB=app
3131
POSTGRES_USER=postgres
3232
POSTGRES_PASSWORD=changethis
3333

34-
# PgAdmin
35-
PGADMIN_DEFAULT_EMAIL=admin@example.com
36-
PGADMIN_DEFAULT_PASSWORD=changethis
37-
PGADMIN_LISTEN_PORT=5050
38-
3934
SENTRY_DSN=
4035

4136
# Flower

.github/workflows/deploy-production.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
2222
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
2323
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
24-
PGADMIN_DEFAULT_EMAIL: ${{ secrets.PGADMIN_DEFAULT_EMAIL }}
25-
PGADMIN_DEFAULT_PASSWORD: ${{ secrets.PGADMIN_DEFAULT_PASSWORD }}
2624
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
2725
FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
2826
steps:

.github/workflows/deploy-staging.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
2222
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
2323
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
24-
PGADMIN_DEFAULT_EMAIL: ${{ secrets.PGADMIN_DEFAULT_EMAIL }}
25-
PGADMIN_DEFAULT_PASSWORD: ${{ secrets.PGADMIN_DEFAULT_PASSWORD }}
2624
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
2725
FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
2826
steps:

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ The input variables, with their default values (some auto generated) are:
154154
- `smtp_password`: (default: "") The SMTP server password to send emails, you can set it later in .env.
155155
- `emails_from_email`: (default: `"info@example.com"`) The email account to send emails from, you can set it later in .env.
156156
- `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.
157-
- `pgadmin_default_user`: (default: `"admin"`) The default user for pgAdmin, you can set it later in .env.
158-
- `pgadmin_default_password`: (default: `"changethis"`) The default user password for pgAdmin, stored in .env.
159157
- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.
160158
- `flower_basic_auth`: (default: `"admin:changethis"`) The basic auth for Flower, you can set it later in .env.
161159

backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Backend, JSON based web API based on OpenAPI: http://localhost/api/
2121

2222
Automatic interactive documentation with Swagger UI (from the OpenAPI backend): http://localhost/docs
2323

24-
PGAdmin, PostgreSQL web administration: http://localhost:5050
24+
Adminer, database web administration: http://localhost:8080
2525

2626
Flower, administration of Celery tasks: http://localhost:5555
2727

copier.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ postgres_password:
5454
python -c "import secrets; print(secrets.token_urlsafe(32))"'
5555
default: changethis
5656

57-
pgadmin_default_email:
58-
type: str
59-
help: The default user email for pgAdmin, you can set it later in .env
60-
default: admin@example.com
61-
62-
pgadmin_default_password:
63-
type: str
64-
help: The default user password for pgAdmin, stored in .env
65-
default: changethis
66-
6757
sentry_dsn:
6858
type: str
6959
help: The DSN for Sentry, if you are using it, you can set it later in .env

deployment.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ But you have to configure a couple things first. 🤓
1212

1313
* Have a remote server ready and available.
1414
* Configure the DNS records of your domain to point to the IP of the server you just created.
15-
* Configure a wildcard subdomain for your domain, so that you can have multiple subdomains for different services, e.g. `*.fastapi-project.example.com`. This will be useful for accessing different components, like `traefik.fastapi-project.example.com`, `pgadmin.fastapi-project.example.com`, etc. And also for `staging`, like `staging.fastapi-project.example.com`, `staging.pgadmin.fastapi-project.example.com`, etc.
15+
* Configure a wildcard subdomain for your domain, so that you can have multiple subdomains for different services, e.g. `*.fastapi-project.example.com`. This will be useful for accessing different components, like `traefik.fastapi-project.example.com`, `adminer.fastapi-project.example.com`, etc. And also for `staging`, like `staging.fastapi-project.example.com`, `staging.adminer.fastapi-project.example.com`, etc.
1616
* Install and configure [Docker](https://docs.docker.com/engine/install/) on the remote server (Docker Engine, not Docker Desktop).
1717

1818
## Public Traefik
@@ -141,8 +141,6 @@ You can set several variables, like:
141141
* `POSTGRES_PASSWORD`: The Postgres password.
142142
* `POSTGRES_USER`: The Postgres user, you can leave the default.
143143
* `POSTGRES_DB`: The database name to use for this application. You can leave the default of `app`.
144-
* `PGADMIN_DEFAULT_EMAIL`: The default email for pgAdmin.
145-
* `PGADMIN_DEFAULT_PASSWORD`: The default password for pgAdmin.
146144
* `SENTRY_DSN`: The DSN for Sentry, if you are using it.
147145
* `FLOWER_BASIC_AUTH`: The HTTP Basic Auth for Flower, like `admin:changethis`.
148146

@@ -253,8 +251,6 @@ The current Github Actions workflows expect these secrets:
253251
* `EMAILS_FROM_EMAIL`
254252
* `FIRST_SUPERUSER`
255253
* `FIRST_SUPERUSER_PASSWORD`
256-
* `PGADMIN_DEFAULT_EMAIL`
257-
* `PGADMIN_DEFAULT_PASSWORD`
258254
* `POSTGRES_PASSWORD`
259255
* `SECRET_KEY`
260256

@@ -283,7 +279,7 @@ Backend API docs: `https://fastapi-project.example.com/docs`
283279

284280
Backend API base URL: `https://fastapi-project.example.com/api/`
285281

286-
PGAdmin: `https://pgadmin.fastapi-project.example.com`
282+
Adminer: `https://adminer.fastapi-project.example.com`
287283

288284
Flower: `https://flower.fastapi-project.example.com`
289285

@@ -295,6 +291,6 @@ Backend API docs: `https://staging.fastapi-project.example.com/docs`
295291

296292
Backend API base URL: `https://staging.fastapi-project.example.com/api/`
297293

298-
PGAdmin: `https://staging.pgadmin.fastapi-project.example.com`
294+
Adminer: `https://staging.adminer.fastapi-project.example.com`
299295

300296
Flower: `https://staging.flower.fastapi-project.example.com`

development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Automatic Interactive Docs (Swagger UI): https://localhost/docs
107107

108108
Automatic Alternative Docs (ReDoc): https://localhost/redoc
109109

110-
PGAdmin: http://localhost:5050
110+
Adminer: http://localhost:8080
111111

112112
Flower: http://localhost:5555
113113

@@ -125,7 +125,7 @@ Automatic Interactive Docs (Swagger UI): https://localhost.tiangolo.com/docs
125125

126126
Automatic Alternative Docs (ReDoc): https://localhost.tiangolo.com/redoc
127127

128-
PGAdmin: http://localhost.tiangolo.com:5050
128+
Adminer: http://localhost.tiangolo.com:8080
129129

130130
Flower: http://localhost.tiangolo.com:5555
131131

docker-compose.override.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ services:
4343
ports:
4444
- "5432:5432"
4545

46-
pgadmin:
46+
adminer:
4747
restart: "no"
4848
ports:
49-
- "5050:5050"
49+
- "8080:8080"
5050

5151
queue:
5252
restart: "no"

docker-compose.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,28 @@ services:
1313
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
1414
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
1515

16-
pgadmin:
17-
image: dpage/pgadmin4
16+
adminer:
17+
image: adminer
1818
restart: always
1919
networks:
2020
- traefik-public
2121
- default
2222
depends_on:
2323
- db
24-
env_file:
25-
- .env
2624
environment:
27-
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
28-
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
25+
- ADMINER_DESIGN=pepa-linha-dark
2926
labels:
3027
- traefik.enable=true
3128
- traefik.docker.network=traefik-public
3229
- traefik.constraint-label=traefik-public
33-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.rule=Host(`pgadmin.${DOMAIN?Variable not set}`)
34-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.entrypoints=http
35-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-http.middlewares=https-redirect
36-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.rule=Host(`pgadmin.${DOMAIN?Variable not set}`)
37-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.entrypoints=https
38-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls=true
39-
- traefik.http.routers.${STACK_NAME?Variable not set}-pgadmin-https.tls.certresolver=le
40-
- traefik.http.services.${STACK_NAME?Variable not set}-pgadmin.loadbalancer.server.port=5050
30+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.rule=Host(`adminer.${DOMAIN?Variable not set}`)
31+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.entrypoints=http
32+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.middlewares=https-redirect
33+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.rule=Host(`adminer.${DOMAIN?Variable not set}`)
34+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.entrypoints=https
35+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls=true
36+
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls.certresolver=le
37+
- traefik.http.services.${STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080
4138

4239
queue:
4340
image: rabbitmq:3

0 commit comments

Comments
 (0)