-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.migrate.yml
46 lines (44 loc) · 1.65 KB
/
docker-compose.migrate.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
version: '2.4'
services:
migrate_api:
build:
context: ./api
args:
- http_proxy
- https_proxy
working_dir: /usr/src/app
environment:
- http_proxy
- https_proxy
- EZMESURE_POSTGRES_URL=postgresql://${EZMESURE_POSTGRES_USER:-postgres}:${EZMESURE_POSTGRES_PASSWORD:-changeme}@${EZMESURE_POSTGRES_HOST:-postgres}:${EZMESURE_POSTGRES_PORT:-5432}/${EZMESURE_POSTGRES_DB:-ezmesure}
restart: "no"
entrypoint: ""
command: ["/bin/sh", "-c", "npm install prisma && npm run db:migrate"]
depends_on:
postgres:
condition: service_healthy
migrate_reporting:
image: ghcr.io/ezpaarse-project/ezreeport-report:1.5.0
entrypoint: ""
command: ["/bin/sh", "-c", "npm run db:install && npm run db:migrate"]
environment:
- http_proxy
- https_proxy
- DATABASE_URL=postgresql://${EZMESURE_POSTGRES_USER:-postgres}:${EZMESURE_POSTGRES_PASSWORD:-changeme}@${EZMESURE_POSTGRES_HOST:-postgres}:${EZMESURE_POSTGRES_PORT:-5432}/${EZREEPORT_POSTGRES_DB:-ezreeport}?schema=public
depends_on:
postgres:
condition: service_healthy
restart: "no"
postgres:
image: postgres:15.1-alpine3.16
restart: unless-stopped
environment:
- POSTGRES_USER=${EZMESURE_POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${EZMESURE_POSTGRES_PASSWORD:-changeme}
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${EZMESURE_POSTGRES_USER:-postgres}"]
interval: ${POSTGRES_HEALTHCHECK_INTERVAL:-10s}
timeout: ${POSTGRES_HEALTHCHECK_TIMEOUT:-5s}
retries: ${POSTGRES_HEALTHCHECK_RETRIES:-5}