mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
- Introduced Vite as the new build tool for the web frontend, enhancing performance and development speed. - Added essential components including landing, login, and admin pages. - Implemented Zustand for state management and integrated error boundaries for improved error handling. - Established a unified API client and validation schemas for consistent data handling. - Created comprehensive test setups and initial tests for core functionalities.
143 lines
4.3 KiB
YAML
143 lines
4.3 KiB
YAML
services:
|
|
postgres:
|
|
image: "ankane/pgvector:v0.5.1"
|
|
container_name: "omnivore-postgres-dev"
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: omnivore
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d omnivore"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
migrate:
|
|
build:
|
|
context: .
|
|
dockerfile: ./packages/db/Dockerfile
|
|
container_name: "omnivore-migrate-dev"
|
|
environment:
|
|
- PGPASSWORD=postgres
|
|
- POSTGRES_USER=postgres
|
|
- PG_HOST=postgres
|
|
- PG_USER=postgres
|
|
- PG_PASSWORD=postgres
|
|
- PG_DB=omnivore
|
|
- NO_DEMO_USER=true
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command: >
|
|
sh -c "
|
|
echo 'Creating database and users...'
|
|
psql -h postgres -U postgres -c 'CREATE DATABASE omnivore;' || true
|
|
psql -h postgres -U postgres -c \"CREATE USER app_user WITH ENCRYPTED PASSWORD 'postgres';\" || true
|
|
echo 'Running migrations...'
|
|
cd /app/packages/db && yarn migrate
|
|
echo 'Granting permissions...'
|
|
psql -h postgres -U postgres -d omnivore -c 'GRANT omnivore_user TO app_user;' || true
|
|
echo 'Migration completed successfully'
|
|
"
|
|
|
|
api-nest:
|
|
build:
|
|
context: .
|
|
dockerfile: packages/api-nest/Dockerfile
|
|
target: builder
|
|
container_name: "omnivore-api-nest-dev"
|
|
ports:
|
|
- "4001:4001"
|
|
environment:
|
|
- NODE_ENV=development
|
|
- NEST_PORT=4001
|
|
- DATABASE_HOST=postgres
|
|
- DATABASE_PORT=5432
|
|
- DATABASE_USER=postgres
|
|
- DATABASE_PASSWORD=postgres
|
|
- DATABASE_NAME=omnivore
|
|
- REDIS_URL=redis://redis:6379
|
|
- JWT_SECRET=dev-jwt-secret-at-least-32-characters-long-for-development
|
|
- FRONTEND_URL=http://localhost:3000
|
|
# Optional OAuth (using dummy values for development)
|
|
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID:-dummy-client-id-for-development}
|
|
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET:-dummy-secret}
|
|
- GOOGLE_IOS_CLIENT_ID=${GOOGLE_IOS_CLIENT_ID:-dummy-ios-client-id}
|
|
- GOOGLE_ANDROID_CLIENT_ID=${GOOGLE_ANDROID_CLIENT_ID:-dummy-android-client-id}
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
volumes:
|
|
- ./packages/api-nest:/app/packages/api-nest
|
|
- ./packages/db:/app/packages/db
|
|
- ./tsconfig.base.json:/app/tsconfig.base.json
|
|
- /app/packages/api-nest/node_modules
|
|
command: yarn start:dev
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
'node -e "require(''http'').get(''http://localhost:4001/api/v2/health'', (res) => process.exit(res.statusCode === 200 ? 0 : 1)).on(''error'', () => process.exit(1))"',
|
|
]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
web-vite:
|
|
build:
|
|
context: .
|
|
dockerfile: packages/web-vite/Dockerfile.dev
|
|
container_name: "omnivore-web-vite-dev"
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
# Vite Environment
|
|
- NODE_ENV=development
|
|
- VITE_APP_ENV=local
|
|
|
|
# API Configuration
|
|
- VITE_API_URL=http://localhost:4001/api/v2
|
|
- VITE_SERVER_BASE_URL=http://localhost:4001
|
|
|
|
# Base URLs
|
|
- VITE_BASE_URL=http://localhost:3000
|
|
- VITE_HIGHLIGHTS_BASE_URL=http://localhost:3000
|
|
- VITE
|
|
|
|
# OAuth Configuration (dummy values for development UI testing)
|
|
- VITE_GAUTH_CLIENT_ID=${GAUTH_CLIENT_ID:-dummy-google-client-id-for-development.apps.googleusercontent.com}
|
|
- VITE_GAUTH_IOS_CLIENT_ID=${GAUTH_IOS_CLIENT_ID:-dummy-ios-client-id}
|
|
- VITE_GAUTH_ANDROID_CLIENT_ID=${GAUTH_ANDROID_CLIENT_ID:-dummy-android-client-id}
|
|
- VITE_APPLE_CLIENT_ID=${APPLE_CLIENT_ID:-dummy-apple-client-id}
|
|
depends_on:
|
|
api-nest:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./packages/web-vite:/app/packages/web-vite
|
|
- /app/packages/web-vite/node_modules
|
|
command: npm run dev -- --host 0.0.0.0 --port 3000
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: "redis:7.2.4"
|
|
container_name: "omnivore-redis-dev"
|
|
expose:
|
|
- 6379
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: redis-cli ping
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 30
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|