Skip to content

Instantly share code, notes, and snippets.

@laurazenc
Created February 6, 2019 16:07
Show Gist options
  • Save laurazenc/1e7cdecc95ce8e195b31c77ea67fe273 to your computer and use it in GitHub Desktop.
Save laurazenc/1e7cdecc95ce8e195b31c77ea67fe273 to your computer and use it in GitHub Desktop.
Docker PostgresSQL
// Access bash from postgres container
docker exec -it <DOCKERCONTAINER_NAME> bash
// Access with defined user in docker-compose.yaml
psql -U postgres
version: "3.1"
services:
db:
image: postgres:alpine
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment