fix(server): docker-compose fix

This commit is contained in:
Neko Ayaka
2026-01-05 16:26:44 +08:00
committed by RainbowBird
parent ddde54d22f
commit 8cbdb6be2e
3 changed files with 17 additions and 10 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ RUN corepack enable
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./ COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
COPY apps/server apps/server COPY apps/server apps/server
RUN pnpm install --frozen-lockfile --ignore-scripts RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile --ignore-scripts
EXPOSE 3000 EXPOSE 3000
+14 -9
View File
@@ -1,22 +1,20 @@
version: '3.9' name: proj-airi-api-server
services: services:
db: db:
image: postgres:16-alpine image: ghcr.io/tensorchord/vchord-postgres:pg18-v1.0.0
container_name: airi-postgres
environment: environment:
- POSTGRES_DB=airi - POSTGRES_PASSWORD=example-P@ssw0rd-xHjDYR.b7N
- POSTGRES_USER=airi
- POSTGRES_PASSWORD=airi
ports: ports:
- '5432:5432' - '5432:5432'
volumes:
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
- db_data:/var/lib/postgresql
healthcheck: healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB'] test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 10 retries: 10
volumes:
- ${serviceName}_data:/var/lib/postgresql/data
server: server:
build: build:
@@ -25,8 +23,15 @@ services:
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
environment:
- DATABASE_URL=postgresql://postgres:example-P@ssw0rd-xHjDYR.b7N@db:5432/postgres
ports: ports:
- '3000:3000' - '6112:3000'
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:3000/health || exit 1']
interval: 10s
timeout: 5s
retries: 5
volumes: volumes:
db_data: db_data:
+1
View File
@@ -0,0 +1 @@
CREATE EXTENSION vchord CASCADE;