mirror of
https://github.com/jetkvm/cloud-api.git
synced 2025-09-16 08:38:15 +00:00
34 lines
712 B
YAML
34 lines
712 B
YAML
services:
|
|
postgres:
|
|
image: postgres:15
|
|
restart: always
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U jetkvm"]
|
|
interval: 5s
|
|
retries: 5
|
|
timeout: 3s
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NODE_ENV: production
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
expose:
|
|
- "3000:3000"
|
|
command: ["sh", "-c", "until pg_isready -h postgres -U jetkvm; do sleep 2; done && npx prisma migrate deploy && exec node -r ts-node/register ./src/index.ts"]
|
|
|
|
volumes:
|
|
pgdata:
|