From e888f43ce77abc359dc46bca1bbed91ee9dcc2a6 Mon Sep 17 00:00:00 2001 From: theycallhermax Date: Fri, 28 Feb 2025 21:29:48 -0500 Subject: [PATCH] port docker compose to postgres --- config.example.json | 2 +- docker-compose.yml | 72 ++++++++++++++++++++++----------------------- requirements.txt | 2 +- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/config.example.json b/config.example.json index 7f6ffaf..a8fa41d 100644 --- a/config.example.json +++ b/config.example.json @@ -58,7 +58,7 @@ "topic": "" }, "themeStoreUrl": "http://127.0.0.1:8000", - "username": "", + "username": "a", "trimContentAfter": "150", "charLimit": "512", "anonName": "Anonymous", diff --git a/docker-compose.yml b/docker-compose.yml index 2c7ad81..cdf3e6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,44 +1,44 @@ name: catask services: - mariadb: - environment: - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1 - MARIADB_DATABASE: catask - MARIADB_USER: catask - MARIADB_PASSWORD: catask - MARIADB_ROOT_HOST: "%" - healthcheck: - test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] - start_period: 10s - interval: 10s - timeout: 5s - retries: 3 - image: mariadb - networks: - - catask - restart: always - volumes: - - ./schema.sql:/docker-entrypoint-initdb.d/1.sql - - db-data:/var/lib/mysql + postgres: + environment: + POSTGRES_DB: catask + POSTGRES_USER: catask + POSTGRES_PASSWORD: catask + healthcheck: + test: ["CMD", "pg_isready", "-U", "catask"] + interval: 1s + timeout: 5s + retries: 10 + image: postgres:alpine + networks: + - catask + restart: always + volumes: + - ./schema.sql:/docker-entrypoint-initdb.d/catask.sql + - db-data:/var/lib/postgresql/data - catask: - build: - dockerfile: Dockerfile - depends_on: - mariadb: - condition: service_healthy - networks: - - catask - ports: - - "8000:8000" - volumes: - - ./config.json:/catask/config.json - - ./.env:/catask/.env + catask: + build: + dockerfile: Dockerfile + depends_on: + postgres: + condition: service_healthy + networks: + - catask + ports: + - "8000:8000" + restart: always + volumes: + - emoji-data:/catask/static/emojis + - ./config.json:/catask/config.json + - ./.env:/catask/.env networks: - catask: - driver: bridge + catask: + driver: bridge volumes: - db-data: \ No newline at end of file + db-data: + emoji-data: diff --git a/requirements.txt b/requirements.txt index ad13b40..55fbc88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ flask python-dotenv -psycopg +psycopg[binary,pool] humanize mistune bleach