File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ PROTOC_VERSION=3.9.1
3636PROTOC_ARCH = ${ DEFAULT_ARCH }
3737PROTOC_BASE = ${ DEFAULT_BASE }
3838POSTGRES_VERSION = 14.2
39- PSQL_VERSION = ${ POSTGRES_VERSION }
4039PYTHON_VERSION = 3.10
4140PYTHON2_VERSION = 2.7.18
4241RUBY_VERSION = 3.1.1
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ dockerized <command>
2323- Database
2424 - dolt
2525 - mysql
26+ - [ postgres] ( apps/postgres/README.md )
27+ - psql
28+ - pg_dump
29+ - pg_dumpall
2630- Dev-Ops & Docker
2731 - ansible
2832 - ansible-playbook
Original file line number Diff line number Diff line change 1+ # dockerized postgres
2+
3+ You can use dockerized postgres to query your database, and manage backups, without locally installing postgres.
4+
5+ The commands work as usual, except:
6+
7+ - Use ` host.docker.internal ` instead of ` localhost ` .
8+ - You can only access files in the current working directory (e.g. when dumping).
9+
10+ ## psql
11+
12+ ``` shell
13+ dockerized psql --host " host.docker.internal" --username < username>
14+ ```
15+
16+ ## pg_dumpall
17+
18+ ``` shell
19+ dockerized pg_dumpall \
20+ --host " host.docker.internal" \
21+ --file " backup.sql" \
22+ --username root \
23+ --no-password \
24+ --quote-all-identifiers \
25+ --verbose
26+ ```
Original file line number Diff line number Diff line change @@ -156,8 +156,14 @@ services:
156156 php :
157157 image : " php:${PHP_VERSION}"
158158 psql :
159- image : " postgres:${PSQL_VERSION }"
159+ image : " postgres:${POSTGRES_VERSION }"
160160 entrypoint : [ "psql" ]
161+ pg_dump :
162+ image : " postgres:${POSTGRES_VERSION}"
163+ entrypoint : [ "pg_dump" ]
164+ pg_dumpall :
165+ image : " postgres:${POSTGRES_VERSION}"
166+ entrypoint : [ "pg_dumpall" ]
161167 protoc :
162168 image : " protoc:${PROTOC_VERSION}"
163169 build :
You can’t perform that action at this time.
0 commit comments