-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.base.yml
31 lines (29 loc) · 962 Bytes
/
compose.base.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
services:
postgres:
container_name: clip-postgres
image: postgres:16
restart: unless-stopped
ports:
- ${POSTGRESQL_PORT}:${POSTGRESQL_PORT}
environment:
POSTGRES_USER: ${POSTGRESQL_USER}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRES_DB: ${POSTGRESQL_DATABASE_NAME}
volumes:
- postgres_volume:/var/lib/postgresql/data:Z
healthcheck:
test: ["CMD-SHELL", "pg_isready -d clip -U clip"]
interval: 5s
migrations:
container_name: clip-migrations
working_dir: /migrations
restart: on-failure
build:
context: ./migrations
network: host
entrypoint: /root/.dotnet/tools/dotnet-badgie-migrator 'Host=${POSTGRESQL_HOST};Port=${POSTGRESQL_PORT};Database=${POSTGRESQL_DATABASE_NAME};Username=${POSTGRESQL_USER};Password=${POSTGRESQL_PASSWORD};' './*.sql' -i -d:Postgres
depends_on:
postgres:
condition: service_healthy
volumes:
postgres_volume: