Docker Postgres Config

on visual studio code :

$ docker pull postgres

start a postgres instance

$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
$ docker exec -it 1ddd37ea6aa5 /bin/bash 

on DockerDesktop press cli

#su – postgres


postgres=# show config_file;

postgres=# \q

postgres@1ddd37ea6aa5:~$ exit

# apt-get update (because postgres is on ubuntu default)

# apt-get install vim

# su – postgres

vim /var/lib/postgresql/data/postgresql.conf

make changes in parameters :wq to save and exit

at visual studio code:

$ docker ps -a
$ docker restart <postgres_container_id>

That’s all.

Leave a Reply

Your email address will not be published. Required fields are marked *