- اتصال کامل فرانت به API: همه محتوای سایت (پروژهها، مقالات، خدمات، برند و...) از بکاند خوانده میشود (SiteProvider + useSite) - فرم تماس و خبرنامه متصل به بکاند و تستشده در مرورگر - ساختار مونوریپو: frontend/ + backend/ - Dockerfile برای هر دو بخش + docker-compose (PostgreSQL + FastAPI + nginx) - nginx با پروکسی /api — بدون نیاز به CORS در حالت داکر - README کامل فارسی
45 lines
1008 B
YAML
45 lines
1008 B
YAML
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: aramesh
|
|
POSTGRES_PASSWORD: aramesh
|
|
POSTGRES_DB: arameshplaza
|
|
volumes:
|
|
- db_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U aramesh -d arameshplaza"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 12
|
|
|
|
backend:
|
|
build: ./backend
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://aramesh:aramesh@db:5432/arameshplaza
|
|
SECRET_KEY: change-me-to-a-long-random-string
|
|
CORS_ORIGINS: '["http://localhost:5173","http://127.0.0.1:5173"]'
|
|
ADMIN_USERNAME: admin
|
|
ADMIN_PASSWORD: aramesh123
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
args:
|
|
VITE_API_URL: ""
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend
|
|
ports:
|
|
- "5173:80"
|
|
|
|
volumes:
|
|
db_data:
|