From 8e120f2ec5b64acdd2adf56f6d44892d9af1f633 Mon Sep 17 00:00:00 2001 From: Karthik Balakrishnan Date: Sun, 14 May 2023 14:33:42 +0000 Subject: [PATCH 1/2] docker compose deployment --- docker-compose/README.md | 10 ++++ docker-compose/docker-compose.example.yml | 69 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 docker-compose/README.md create mode 100644 docker-compose/docker-compose.example.yml diff --git a/docker-compose/README.md b/docker-compose/README.md new file mode 100644 index 0000000..2dc8a39 --- /dev/null +++ b/docker-compose/README.md @@ -0,0 +1,10 @@ +# Docker Compose Example + +This is the simplest way to get started with Takahe. + +## Quick Start + +1. Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/) on your platform +2. Copy the `docker-compose.example.yml` provider here and rename it as `docker-compose.yml` +3. Update the environment variables as described in [Takahe's documentation](https://docs.jointakahe.org/en/latest/installation/#environment-variables) +4. Run `docker compose up -d` to run everything. diff --git a/docker-compose/docker-compose.example.yml b/docker-compose/docker-compose.example.yml new file mode 100644 index 0000000..f06a9b9 --- /dev/null +++ b/docker-compose/docker-compose.example.yml @@ -0,0 +1,69 @@ +version: "3.8" + +services: + + db: + image: docker.io/postgres:15-alpine + healthcheck: + test: ['CMD', 'pg_isready', '-U', 'postgres'] + volumes: + - db_data:/var/lib/postgresql/data + restart: always + environment: + POSTGRES_DB: takahe + POSTGRES_USER: postgres + POSTGRES_PASSWORD: change_me_to_an_actual_password + ports: + - "5433:5432" + + web: + image: jointakahe/takahe:latest + environment: + TAKAHE_DATABASE_SERVER: "postgres://postgres:change_me_to_an_actual_password@db/takahe" + TAKAHE_SECRET_KEY: "a_random_secret" + TAKAHE_EMAIL_SERVER: "" + TAKAHE_EMAIL_FROM: "postmaster@your.domain.com" + TAKAHE_AUTO_ADMIN_EMAIL: "youremail@domain.com" + TAKAHE_MEDIA_BACKEND: "local://" + TAKAHE_MAIN_DOMAIN: "" + TAKAHE_STATOR_TOKEN: "another_random_secret" + restart: always + depends_on: + - db + volumes: + - web_data:/takahe/ + - media_data:/takahe_media/ + healthcheck: + test: ["CMD", "nc", "-z", "-v", "localhost", "8000"] + interval: 20s + timeout: 60s + start_period: 15s + ports: + - "8000:8000" + + stator: + image: jointakahe/takahe:latest + environment: + TAKAHE_DATABASE_SERVER: "postgres://postgres:change_me_to_an_actual_password@db/takahe" + TAKAHE_SECRET_KEY: "a_random_secret" + TAKAHE_EMAIL_SERVER: "" + TAKAHE_EMAIL_FROM: "postmaster@your.domain.com" + TAKAHE_AUTO_ADMIN_EMAIL: "youremail@domain.com" + TAKAHE_MEDIA_BACKEND: "local://" + TAKAHE_MAIN_DOMAIN: "" + TAKAHE_STATOR_TOKEN: "another_random_secret" + restart: always + depends_on: + - db + volumes: + - web_data:/takahe/ + - media_data:/takahe_media/ + command: ["/takahe/manage.py", "runstator"] + +networks: + default: + +volumes: + db_data: + web_data: + media_data: \ No newline at end of file From 67e18e48e2e15ff3eb0e76d5f90601353f0bcb0f Mon Sep 17 00:00:00 2001 From: Karthik Balakrishnan Date: Mon, 26 Jun 2023 23:10:44 +0530 Subject: [PATCH 2/2] Update docker-compose.example.yml --- docker-compose/docker-compose.example.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker-compose/docker-compose.example.yml b/docker-compose/docker-compose.example.yml index f06a9b9..102408f 100644 --- a/docker-compose/docker-compose.example.yml +++ b/docker-compose/docker-compose.example.yml @@ -31,7 +31,6 @@ services: depends_on: - db volumes: - - web_data:/takahe/ - media_data:/takahe_media/ healthcheck: test: ["CMD", "nc", "-z", "-v", "localhost", "8000"] @@ -56,7 +55,6 @@ services: depends_on: - db volumes: - - web_data:/takahe/ - media_data:/takahe_media/ command: ["/takahe/manage.py", "runstator"] @@ -65,5 +63,4 @@ networks: volumes: db_data: - web_data: - media_data: \ No newline at end of file + media_data: