forked from datalad/datalad-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.read-only.yml
50 lines (44 loc) · 1.63 KB
/
docker-compose.read-only.yml
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
services:
read-only-web:
build:
dockerfile: Dockerfile
## Old docker-compose asked for context but this was still insufficient
## since it could then "link" the built image here to be used for the worker
# context: .
image: datalad-registry
depends_on:
read-only-db:
condition: service_healthy
ports:
- "${READ_ONLY_WEB_PUBLISH_PORT}:5000"
environment:
FLASK_APP: "datalad_registry:create_app"
DATALAD_REGISTRY_OPERATION_MODE: "READ_ONLY"
DATALAD_REGISTRY_INSTANCE_PATH: /app/instance
# db service access info
SQLALCHEMY_DATABASE_URI: "${SQLALCHEMY_DATABASE_URI}"
command: [ "bash", "-c", "flask init-db && flask run --host=0.0.0.0" ]
volumes:
- ${WEB_PATH_AT_HOST}/instance:/app/instance
read-only-db:
image: docker.io/postgres:15
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_INITDB_ARGS: --encoding utf8 --locale C
# Enable command below to run the container without starting PostgreSQL
# command: ["tail", "-f", "/dev/null"]
userns_mode: "keep-id" # This has an effect only after podman-compose 1.0.3 possibly
# See https://github.com/containers/podman-compose/issues/166
# for details.
# For podman-compose 1.0.3 or earlier, use
# `PODMAN_USERNS=keep-id podman-compose up`
volumes:
- ${DB_PATH_AT_HOST}/data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
interval: 30s
timeout: 30s
retries: 3
start_period: 1m