From 652f7e48783d8784902e5e7c6989321f58c201ad Mon Sep 17 00:00:00 2001 From: Luke Van Seters Date: Thu, 22 Jul 2021 16:35:19 -0400 Subject: [PATCH] Add DB + PGAdmin --- .env | 10 ++++++++++ Dockerfile | 3 +++ docker-compose.yml | 27 +++++++++++++++++++++++++++ run.sh | 4 ++++ 4 files changed, 44 insertions(+) create mode 100644 .env create mode 100755 run.sh diff --git a/.env b/.env new file mode 100644 index 0000000..c9a9b94 --- /dev/null +++ b/.env @@ -0,0 +1,10 @@ +# Postgres +POSTGRES_SERVER=db +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +POSTGRES_DB=mev_inspect + +# PgAdmin +PGADMIN_LISTEN_PORT=5050 +PGADMIN_DEFAULT_EMAIL=admin@example.com +PGADMIN_DEFAULT_PASSWORD=password diff --git a/Dockerfile b/Dockerfile index 832b85c..df98198 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,3 +5,6 @@ RUN pip install -r /app/requirements.txt COPY . /app WORKDIR /app/ + +ENTRYPOINT ["./run.sh"] +CMD [] diff --git a/docker-compose.yml b/docker-compose.yml index 4e859e8..a82f926 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,32 @@ services: mev-inspect: build: . + depends_on: + - db + env_file: + - .env volumes: - .:/app + + db: + image: postgres:12 + volumes: + - mev-inspect-db-data:/var/lib/postgresql/data/pgdata + env_file: + - .env + environment: + - PGDATA=/var/lib/postgresql/data/pgdata + + pgadmin: + image: dpage/pgadmin4 + networks: + - default + depends_on: + - db + env_file: + - .env + ports: + - "5050:5050" + +volumes: + mev-inspect-db-data: diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..db2c946 --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Ah, ha, ha, ha, stayin' alive... +while :; do :; done & kill -STOP $! && wait $!