From 696924b5ef11ca82ba8b66d67a9e85cab04ebf5e Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 26 Jul 2020 15:31:16 -0400 Subject: feat(web/panettone): Add dev helpers for postgres db Add a docker-compose file and lorri-based direnv for aiding in running and connecting to a postgres database during development of panettone. Change-Id: I319eee52b52cd48e1f3d2e32c558989768dc19d8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1465 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: eta --- third_party/default.nix | 1 + web/panettone/.envrc | 1 + web/panettone/docker-compose.yml | 11 +++++++++++ web/panettone/shell.nix | 15 +++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 web/panettone/.envrc create mode 100644 web/panettone/docker-compose.yml create mode 100644 web/panettone/shell.nix diff --git a/third_party/default.nix b/third_party/default.nix index d1fd9f370f02..dcb4a42acb6a 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -64,6 +64,7 @@ let dfu-util diffutils dockerTools + docker-compose execline fd fetchFromGitHub diff --git a/web/panettone/.envrc b/web/panettone/.envrc new file mode 100644 index 000000000000..be81feddb1a5 --- /dev/null +++ b/web/panettone/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" \ No newline at end of file diff --git a/web/panettone/docker-compose.yml b/web/panettone/docker-compose.yml new file mode 100644 index 000000000000..84723667e6b9 --- /dev/null +++ b/web/panettone/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.4' +services: + postgres: + image: postgres:11 + restart: always + environment: + POSTGRES_USER: panettone + POSTGRES_PASSWORD: password + POSTGRES_DB: panettone + ports: + - 127.0.0.1:5432:5432 diff --git a/web/panettone/shell.nix b/web/panettone/shell.nix new file mode 100644 index 000000000000..aeafc7afcd99 --- /dev/null +++ b/web/panettone/shell.nix @@ -0,0 +1,15 @@ +{ depot ? import ../.. {} }: + +with depot.third_party; + +mkShell { + buildInputs = [ + docker-compose + postgresql + ]; + + PGPASSWORD = "password"; + PGHOST = "localhost"; + PGUSER = "panettone"; + PGDATABASE = "panettone"; +} -- cgit 1.4.1