update coolify compose
This commit is contained in:
@@ -1,32 +1,38 @@
|
||||
services:
|
||||
api:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
expose:
|
||||
- "${PORT:-3000}"
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: ${PORT:-3000}
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
postgres:
|
||||
image: postgres:18-alpine
|
||||
restart: unless-stopped
|
||||
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
|
||||
]
|
||||
interval: 2s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
environment:
|
||||
PORT: ${PORT:-3000}
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
postgres_data:
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
FROM node:26-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install -g pnpm@12.5.1
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN DATABASE_URL="postgresql://placeholder:placeholder@localhost:5432/placeholder" \
|
||||
pnpm prisma generate
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
CMD ["sh", "-c", "pnpm prisma migrate deploy && pnpm prisma db seed && pnpm start:prod"]
|
||||
Reference in New Issue
Block a user