fix owner and dirs

This commit is contained in:
Sergey Paramoshkin 2025-12-07 10:58:24 +03:00
parent 07c89c620c
commit 1089d57adf
3 changed files with 89 additions and 0 deletions

75
CLAUDE.md Normal file
View File

@ -0,0 +1,75 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Overview
This is a Docker Compose infrastructure configuration repository for the **staging** environment of the dot-dot.ru platform. It contains service configurations, environment files, and deployment scripts.
## Common Commands
All commands are run via `./app.sh`:
```bash
./app.sh up # Start all services (docker compose up -d + nginx reload)
./app.sh down # Stop all services
./app.sh init # Initialize environment (requires backup in backups/)
./app.sh db # Open MySQL shell
./app.sh console <cmd> # Run Symfony console command
./app.sh composer <cmd> # Run composer in PHP container
./app.sh psalm # Run static analysis
./app.sh php-fixer # Run code style fixer
./app.sh deptrac # Run dependency analysis
./app.sh tests # Run test suite
./app.sh restore-db # Restore database from S3 backup
./app.sh purge-db # Drop and recreate database
```
## Architecture
### Services (docker-compose.yml)
- **backend/php**: Main PHP application (Symfony) with multiple message consumers
- **db**: MariaDB 10.3 database
- **nginx**: Reverse proxy with SSL termination
- **rabbitmq**: Message broker for async processing
- **redis**: Caching layer
- **centrifugo**: WebSocket server for real-time updates
- **lms**: Learning Management System (Node.js)
- **admin**: Admin panel (PHP)
- **cabinet**: Cargo carrier cabinet (Node.js)
- **landing-ttl**: Landing page service
- **1c-view**: 1C integration viewer
### Message Consumers
The PHP application runs several Symfony Messenger consumers as separate containers:
- StatisticExport, OrderImport, ReconciliationAct, WSOrderStateUpdate
- UserTrust, SyncAuctions, SyncCarriers, SyncChangeData
### Configuration Structure
```
configs/
├── nginx/ # Nginx configs and SSL certificates
├── php/ # PHP-FPM config and .env.local
├── rabbitmq/ # RabbitMQ config and definitions
├── lms/ # LMS environment and entrypoint
├── admin/ # Admin panel config
├── cabinet/ # Carrier cabinet config
├── centrifugo/ # WebSocket server config
└── signer/ # Digital signature service (currently disabled)
```
### Environment
- Main environment variables are in `.env`
- Service image tags are controlled via `dotdot_tag`, `LMS_TAG`, `ADMIN_TAG`, etc.
- Network name: `staging`
- MySQL port exposed on: `33067`
### Key Files
- `.env` - Main environment variables and service tags
- `docker-compose.yml` - Service definitions with YAML anchors (`x-defaults-php`)
- `configs/php/.env.local` - PHP application environment

11
configs/php/entrypoint.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
# Create required directories
mkdir -p /application/var/cache
mkdir -p /application/var/log
mkdir -p /application/var/documents
# Fix ownership (www-data uid=33 in php image)
chown -R www-data:www-data /application/var
exec "$@"

View File

@ -13,9 +13,11 @@ volumes:
x-defaults-php: &defaults-php
image: registry.dot-dot.ru/dot-dot:${dotdot_tag}
restart: unless-stopped
entrypoint: /entrypoint.sh
volumes:
- ./configs/php/.env.local:/application/.env.local
- ./configs/php/zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
- ./configs/php/entrypoint.sh:/entrypoint.sh
- php_var_volume:/application/var
- php_support_volume:/application/var/support-issue
- ./configs/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
@ -68,6 +70,7 @@ services:
backend:
<<: *defaults-php
command: php-fpm
php:
command: ./bin/console app:auction:reload