From 65f3ae8cd26fdc9eb0e748aa665c7368e0af6d81 Mon Sep 17 00:00:00 2001 From: alice6373 Date: Thu, 23 Apr 2020 08:43:21 +0800 Subject: [PATCH] Update db setup of README.md Behaviour change in docker-library/postgres newest version. See [docker-library/postgres issue(#681)](https://github.com/docker-library/postgres/issues/681) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 0fb550763..8fb7b3840 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,15 @@ This repository serves the website of PyCon TW, Python Conference Taiwan. This p #### Database - Docker (Optional) +Write database password in .env: + + POSTGRES_PASSWORD=somepassword + +Define .env location in docker-compose-dev.yml: + + env_file: + - .env + Create and start the database for development: docker-compose -f docker-compose-dev.yml up @@ -66,6 +75,11 @@ Then edit the `SECRET_KEY` line in `local.env`, replacing `{{ secret_key }}` int If you’re using a database for the first time, create a database named `pycontw2016` owned by the database user specified in the env file: +> Enter pycontw_db_1 container +```cmd +docker exec -it pycontw_db_1 su - postgres +``` + ```sql # Replace "postgres" with your specified role. create database pycontw2016 with owner = postgres;