blob: 51e5c79c686673600502cb2952caf9b6009c35f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
### CRIMSON --- A simple PHP framework.
### Copyright © 2024 Freya Murphy <contact@freyacat.org>
###
### This file is part of CRIMSON.
###
### CRIMSON is free software; you can redistribute it and/or modify it
### under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 3 of the License, or (at
### your option) any later version.
###
### CRIMSON is distributed in the hope that it will be useful, but
### WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with CRIMSON. If not, see <http://www.gnu.org/licenses/>.
services:
# `docker-compose-api.yml`
# This compose file creates the `rest` container running postgrest. This is
# the program that crimson uses for the default API functionality.
#
# This service stack is only enabled when API_ENABLED=true.
#
# WARNING: The postgres container must also be enabled `POSTGRES_ENABLED=true`
# otherwise the docker stack will be invalid.
rest:
# Postgrest uses postgres to store the api schema. To work properly, the
# database must be working (healthy) and all the api schema must be loaded.
# It is db-init's job to load the api schema, thus this container depends
# on both postgres and db-init.
build: ${CRIMSON_ROOT}/build/postgrest
restart: unless-stopped
env_file: DOCKER_ENV_FILES
healthcheck:
test: curl -I "http://localhost:3000/"
interval: 10s
timeout: 3s
retries: 10
start_period: 3s
depends_on:
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
web:
# Nginx proxies requests to the API making it an added dependency.
depends_on:
rest:
condition: service_healthy
|