Files
clinicpro/.env.coolify.example
T
hamed cffc88db05 feat: Implement Docker-based deployment for ClinicPro on Coolify
- Added Dockerfile for multi-stage build including PHP, Node.js, and Nginx.
- Created docker-compose.coolify.yaml for service orchestration with app, workers, MariaDB, and Redis.
- Introduced entrypoint.sh for initialization tasks like JWT key generation and database migrations.
- Configured Nginx with default.conf for handling requests and routing to PHP-FPM.
- Added php.ini with production settings and opcache configuration.
- Set up supervisord.conf to manage PHP-FPM and Nginx processes.
- Created frontend-domains.json for managing allowed frontend domains.
- Added gen-cors-env.php script to generate CORS environment variables from frontend domains.
- Updated framework.yaml to configure trusted proxies and headers.
- Created .dockerignore to exclude unnecessary files from the Docker context.
- Added .env.coolify.example for environment variable configuration.
- Documented deployment steps and troubleshooting in coolify.md.
2026-06-25 21:27:28 +03:30

47 lines
3.3 KiB
Bash

# ============================================================
# Coolify Environment Variables — ClinicPro (Docker Compose)
# ------------------------------------------------------------
# Copy these into the Coolify resource's "Environment Variables" tab.
# Only the variables referenced as ${...} in docker-compose.coolify.yaml
# need to be set here. DATABASE_URL / MESSENGER_TRANSPORT_DSN / REDIS_URL
# are built INSIDE the compose file from the mariadb/redis service names.
# ============================================================
# ── Backend's own domain (single URL — used for payment callbacks & absolute URLs) ──
# This is the API host, NOT a frontend domain.
APP_BASE_URL=https://api.nobat724.com
# ── Frontend domains (MANY) ──
# Both values below are GENERATED from docker/frontend-domains.json.
# To add/remove a city domain: edit that file, then run:
# ddev exec php docker/gen-cors-env.php (or: php docker/gen-cors-env.php on the server)
# and paste the new output here / into Coolify.
ALLOWED_FRONTEND_HOSTS=ahvaz-nobat.ir,arak-nobat.ir,ardabil-nobat.ir,bandar-nobat.ir,behbahan-nobat.ir,birjand-nobat.ir,bojnord-nobat.ir,bushehr-nobat.ir,dehdasht-nobat.ir,esf-nobat.ir,golestan-nobat.ir,hamadan-nobat.ir,ilam-nobat.ir,karaj-nobat.ir,kerman-nobat.ir,kermanshah-nobat.ir,lorestan-nobat.ir,mashhad-nobat.ir,nobat724.com,qazvin-nobat.ir,qom-nobat.ir,rasht-nobat.ir,sanandaj-nobat.ir,sari-nobat.ir,semnan-nobat.ir,shiraz-nobat.ir,shkord-nobat.ir,tabriz-nobat.ir,tehran-nobat.ir,urmia-nobat.ir,yasuj-nobat.ir,yazd-nobat.ir,zahedan-nobat.ir,zanjan-nobat.ir
CORS_ALLOW_ORIGIN='^https://(ahvaz\-nobat\.ir|arak\-nobat\.ir|ardabil\-nobat\.ir|bandar\-nobat\.ir|behbahan\-nobat\.ir|birjand\-nobat\.ir|bojnord\-nobat\.ir|bushehr\-nobat\.ir|dehdasht\-nobat\.ir|esf\-nobat\.ir|golestan\-nobat\.ir|hamadan\-nobat\.ir|ilam\-nobat\.ir|karaj\-nobat\.ir|kerman\-nobat\.ir|kermanshah\-nobat\.ir|lorestan\-nobat\.ir|mashhad\-nobat\.ir|nobat724\.com|qazvin\-nobat\.ir|qom\-nobat\.ir|rasht\-nobat\.ir|sanandaj\-nobat\.ir|sari\-nobat\.ir|semnan\-nobat\.ir|shiraz\-nobat\.ir|shkord\-nobat\.ir|tabriz\-nobat\.ir|tehran\-nobat\.ir|urmia\-nobat\.ir|yasuj\-nobat\.ir|yazd\-nobat\.ir|zahedan\-nobat\.ir|zanjan\-nobat\.ir)$'
# ── Secrets (REQUIRED — set before the first deploy) ──
APP_SECRET= # php -r "echo bin2hex(random_bytes(32));"
JWT_PASSPHRASE= # openssl rand -hex 32 (must exist before first start: JWT keypair is generated with it)
DB_PASSWORD= # application DB user password
DB_ROOT_PASSWORD= # MariaDB root password
# Tip: in Coolify you may use magic vars instead of hardcoding, e.g.
# DB_PASSWORD=${SERVICE_PASSWORD_DB}
# APP_SECRET=${SERVICE_HEX_APPSECRET}
# ── Reverse proxy (Coolify/Traefik) ──
# Docker internal network ranges so Symfony trusts X-Forwarded-* headers.
TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1
# ── api.ir identity inquiry (Shahkar + IbanMatch) ──
# Empty token => fail-closed (representative verification is rejected).
API_IR_BASE_URL=https://s.api.ir
API_IR_TOKEN=
# ── Notes ──
# • SMS keys (kavenegar/rangineh) and payment gateway keys (mellat/sep) are read
# from the DB ("Site Settings"), NOT from env. No need to set them here.
# • REFRESH_TOKEN_TTL / OTP_TTL / MAX_FILE_SIZE_BYTES are fixed in the compose file.