diff --git a/docker-compose.yml b/docker-compose.yml index dccf644..519c07a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=backend + healthcheck: test: ['CMD', 'pg_isready', '-U', 'postgres'] @@ -36,6 +37,7 @@ services: build: context: . dockerfile: ./docker/Dockerfile.local + restart: always ports: - '8000:80' volumes: diff --git a/docker/init-local.sql b/docker/init-local.sql index 3ca6ca0..bf82e6d 100644 --- a/docker/init-local.sql +++ b/docker/init-local.sql @@ -1,15 +1,18 @@ +-- Use this script to create tables or data seed it if needed. +-- For now, it's not being used but use scripts under the scripts in migrations folder. + -- -- Create user and grant privileges -- CREATE USER root -- WITH PASSWORD '1234' -- ; -- -- Set permission --- GRANT ALL PRIVILEGES ON DATABASE cully TO root; +-- GRANT ALL PRIVILEGES ON DATABASE backend TO postgres; -- -- Create database -- CREATE DATABASE -- WITH --- OWNER = root +-- OWNER = postgres -- ENCODING = 'UTF8' -- LC_COLLATE = 'en_US.utf8' -- LC_CTYPE = 'en_US.utf8'