Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,24 @@ jobs:
# Both are read at module load, so they must be set for every step that
# boots the Nest application (unit tests, e2e tests).
CORS_ALLOWED_ORIGINS: http://localhost:5173
# libSQL creates this file on first connection — no migration or service
# container is needed for the health check's `SELECT 1`.
DATABASE_URL: file:./dev.db
# Points at the Postgres service below. The e2e health check runs a real
# `SELECT 1`, so a live database is required.
DATABASE_URL: postgresql://agrocylo:agrocylo@localhost:5432/agrocylo_pip_test?schema=public

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: agrocylo
POSTGRES_PASSWORD: agrocylo
POSTGRES_DB: agrocylo_pip_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U agrocylo -d agrocylo_pip_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -66,6 +81,9 @@ jobs:
- name: Build
run: npm run build

- name: Apply database migrations
run: npm run db:migrate:deploy

- name: Run unit tests
run: npm test

Expand Down
5 changes: 3 additions & 2 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ WS_AUTH_SECRET=
# One of: trace | debug | info | warn | error | fatal
LOG_LEVEL=info

# Database
DATABASE_URL=file:./dev.db
# Database (PostgreSQL)
# Format: postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public
DATABASE_URL=postgresql://agrocylo:agrocylo@localhost:55432/agrocylo_pip_dev?schema=public

# Soroban RPC Configuration
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
Expand Down
21 changes: 21 additions & 0 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
postgres:
image: postgres:16-alpine
container_name: agrocylo-pg
restart: unless-stopped
environment:
POSTGRES_USER: agrocylo
POSTGRES_PASSWORD: agrocylo
POSTGRES_DB: agrocylo_pip_dev
ports:
- '55432:5432'
volumes:
- agrocylo-pg-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U agrocylo -d agrocylo_pip_dev']
interval: 5s
timeout: 5s
retries: 10

volumes:
agrocylo-pg-data:
Loading
Loading