Last active
June 11, 2020 20:45
-
-
Save oliveira-andre/315ce4e915a24e0dfc9f88484c80be29 to your computer and use it in GitHub Desktop.
configuring docker postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo docker run -d \ | |
| --name=pgadmin4 \ | |
| --restart=always \ | |
| -p 5050:80 \ | |
| -v /etc/localtime:/etc/localtime:ro \ | |
| --link postgres:db \ | |
| -e "[email protected]" \ | |
| -e "PGADMIN_DEFAULT_PASSWORD=root" \ | |
| dpage/pgadmin4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rails new my-app -d postgresql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #downloading postgree | |
| sudo docker pull postgres | |
| #install lib on linux | |
| sudo apt-get install libpq-dev | |
| # install lib on mac | |
| brew install libpq | |
| echo 'PATH="/usr/local/opt/libpq/bin:$PATH"' >> .zshrc | |
| echo 'PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"' >> .zshrc | |
| sudo mkdir /storage/pgdata -p | |
| cd /storage | |
| #setting up | |
| sudo docker run -d \ | |
| --name=postgres \ | |
| -v /etc/localtime:/etc/localtime:ro \ | |
| -e POSTGRES_USER=root \ | |
| -e POSTGRES_PASSWORD=root \ | |
| --mount source=pgdata,target=/var/lib/postgresql/data \ | |
| -p 5432:5432 \ | |
| --restart=always \ | |
| postgres | |
| #giving permissions | |
| sudo chmod +777 /storage/pgdata | |
| sudo chmod +777 /storage/pgdata/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment