Add docker db healthchecks to documentation (#237)

pull/256/head
Candid Dauth 2024-02-19 12:43:24 +01:00
rodzic 5471cb4d7d
commit 8365cf252d
3 zmienionych plików z 30 dodań i 5 usunięć

Wyświetl plik

@ -1,3 +1,6 @@
# This docker-compose file is for internal testing only.
# Please refer to the documentation on https://docs.facilmap.org/developers/server/docker.html for how to start FacilMap with docker.
version: "2" version: "2"
services: services:
facilmap: facilmap:
@ -15,6 +18,9 @@ services:
DB_PASSWORD: facilmap DB_PASSWORD: facilmap
links: links:
- mysql - mysql
depends_on:
mysql:
condition: service_healthy
restart: on-failure restart: on-failure
mysql: mysql:
@ -24,6 +30,9 @@ services:
MYSQL_USER: facilmap MYSQL_USER: facilmap
MYSQL_PASSWORD: facilmap MYSQL_PASSWORD: facilmap
MYSQL_RANDOM_ROOT_PASSWORD: "true" MYSQL_RANDOM_ROOT_PASSWORD: "true"
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
ports: ports:
- "127.0.0.1:40830:3306" - "127.0.0.1:40830:3306"
@ -33,6 +42,8 @@ services:
# POSTGRES_USER: facilmap # POSTGRES_USER: facilmap
# POSTGRES_PASSWORD: facilmap # POSTGRES_PASSWORD: facilmap
# POSTGRES_DB: facilmap # POSTGRES_DB: facilmap
# healthcheck:
# test: pg_isready -d $$POSTGRES_DB
# ports: # ports:
# - "127.0.0.1:40831:5432" # - "127.0.0.1:40831:5432"

Wyświetl plik

@ -20,7 +20,10 @@ services:
ports: ports:
- 8080 - 8080
links: links:
- db - mysql
depends_on:
mysql:
condition: service_healthy
environment: environment:
USER_AGENT: My FacilMap (https://facilmap.example.org/, facilmap@example.org) USER_AGENT: My FacilMap (https://facilmap.example.org/, facilmap@example.org)
TRUST_PROXY: "true" TRUST_PROXY: "true"
@ -36,14 +39,16 @@ services:
MAXMIND_LICENSE_KEY: MAXMIND_LICENSE_KEY:
LIMA_LABS_TOKEN: # Get an API key on https://maps.lima-labs.com/ (optional, needed for double-resolution tiles) LIMA_LABS_TOKEN: # Get an API key on https://maps.lima-labs.com/ (optional, needed for double-resolution tiles)
restart: unless-stopped restart: unless-stopped
db: mysql:
image: mariadb image: mariadb
environment: environment:
MYSQL_DATABASE: facilmap MYSQL_DATABASE: facilmap
MYSQL_USER: facilmap MYSQL_USER: facilmap
MYSQL_PASSWORD: password MYSQL_PASSWORD: password
MYSQL_RANDOM_ROOT_PASSWORD: "true" MYSQL_RANDOM_ROOT_PASSWORD: "true"
cmd: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
restart: unless-stopped restart: unless-stopped
``` ```
@ -57,7 +62,10 @@ services:
ports: ports:
- 8080 - 8080
links: links:
- db - postgres
depends_on:
postgres:
condition: service_healthy
environment: environment:
USER_AGENT: My FacilMap (https://facilmap.example.org/, facilmap@example.org) USER_AGENT: My FacilMap (https://facilmap.example.org/, facilmap@example.org)
TRUST_PROXY: "true" TRUST_PROXY: "true"
@ -73,12 +81,14 @@ services:
MAXMIND_LICENSE_KEY: MAXMIND_LICENSE_KEY:
LIMA_LABS_TOKEN: # Get an API key on https://maps.lima-labs.com/ (optional, needed for double-resolution tiles) LIMA_LABS_TOKEN: # Get an API key on https://maps.lima-labs.com/ (optional, needed for double-resolution tiles)
restart: unless-stopped restart: unless-stopped
db: postgres:
image: postgis/postgis image: postgis/postgis
environment: environment:
POSTGRES_USER: facilmap POSTGRES_USER: facilmap
POSTGRES_PASSWORD: password POSTGRES_PASSWORD: password
POSTGRES_DB: facilmap POSTGRES_DB: facilmap
healthcheck:
test: pg_isready -d $$POSTGRES_DB
restart: unless-stopped restart: unless-stopped
``` ```

Wyświetl plik

@ -22,6 +22,7 @@ services:
MYSQL_USER: facilmap MYSQL_USER: facilmap
MYSQL_PASSWORD: facilmap MYSQL_PASSWORD: facilmap
MYSQL_RANDOM_ROOT_PASSWORD: "true" MYSQL_RANDOM_ROOT_PASSWORD: "true"
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck: healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
@ -30,6 +31,9 @@ services:
image: facilmap-ci image: facilmap-ci
links: links:
- postgres - postgres
depends_on:
postgres:
condition: service_healthy
ports: ports:
- "8081:8080" - "8081:8080"
environment: environment: