# PostgreSQL ## Quick start for Docker-based development This quick start deployment utilizes Alpine-based image. ```bash # pull the image from docker hub VERSION= docker pull postgresql:"$VERSION" # define environment variables cat << EOF > POSTGRESENV POSTGRES_USER= POSTGRES_PASSWORD= POSTGRES_DB= EOF # define container name and ports PGSRV= PGSRVPORT= docker run -d --name "${PGSRV}" --env-file POSTGRESENV -p "${PGSRVPORT}":5432 postgres:"$VERSION" # specify container name for psql configuration, if needed PGCLI= docker run -d --name "${PGCLI}" postgres:"$VERSION" # connect using client container, enter password when prompted PGUSER= PGDB= PGHOST= PGPORT= docker exec -it ${PGCLI} psql -h ${PGHOST} -p ${PGPORT} -U ${PGUSER} -W -d ${PGDB} ```