From a3f3e66f188be64545f35f9e5eaaeff70af0243c Mon Sep 17 00:00:00 2001 From: kzshantonu Date: Tue, 7 Nov 2023 04:51:09 +0100 Subject: [PATCH] docker-compose example with postgres --- README.md | 4 ++++ docker-compose.postgres.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 docker-compose.postgres.yml diff --git a/README.md b/README.md index ce2c38a..6d75fa9 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,10 @@ APP_HASH=abc JWT_SECRET=abc DATABASE_URL=postgres://:@/ +``` +When used with `docker-compose.postgres.yml`: +``` +DATABASE_URL=postgres://teldrive:secret@db/teldrive ``` > **Warning** diff --git a/docker-compose.postgres.yml b/docker-compose.postgres.yml new file mode 100644 index 0000000..3ff843c --- /dev/null +++ b/docker-compose.postgres.yml @@ -0,0 +1,29 @@ +version: "3.8" + +services: + server: + image: ghcr.io/divyam234/teldrive/server + restart: always + container_name: teldrive + volumes: + - ./teldrive.db:/app/teldrive.db:rw + env_file: teldrive.env + ports: + - 8080:8080 + db: + image: postgres:15 + container_name: teldrive_db + restart: always + environment: + - POSTGRES_USER=teldrive + - POSTGRES_PASSWORD=secret + volumes: + - teldrive_db:/var/lib/postgresql/data + healthcheck: + test: ["CMD", "pg_isready", "-U", "teldrive"] + interval: 10s + start_period: 30s + +volumes: + teldrive_db: + \ No newline at end of file