feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
services:
|
2025-12-29 15:37:45 +00:00
|
|
|
mysql:
|
|
|
|
|
image: mysql:8.0
|
|
|
|
|
container_name: dolibarr-mysql
|
|
|
|
|
environment:
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-rootpassword}"
|
2025-12-29 15:37:45 +00:00
|
|
|
MYSQL_DATABASE: "dolibarr"
|
|
|
|
|
MYSQL_USER: "dolibarr"
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-12345678}"
|
2025-12-29 15:37:45 +00:00
|
|
|
ports:
|
|
|
|
|
- "3306:3306"
|
|
|
|
|
volumes:
|
|
|
|
|
- mysql_data:/var/lib/mysql
|
|
|
|
|
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
dolibarr:
|
|
|
|
|
image: dolibarr/dolibarr:latest
|
|
|
|
|
container_name: dolibarr-web
|
|
|
|
|
depends_on:
|
|
|
|
|
mysql:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
environment:
|
|
|
|
|
DOLI_DB_TYPE: "mysqli"
|
|
|
|
|
DOLI_DB_HOST: "mysql"
|
|
|
|
|
DOLI_DB_HOST_PORT: "3306"
|
|
|
|
|
DOLI_DB_USER: "dolibarr"
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
DOLI_DB_PASSWORD: "${MYSQL_PASSWORD:-12345678}"
|
2025-12-29 15:37:45 +00:00
|
|
|
DOLI_DB_NAME: "dolibarr"
|
|
|
|
|
DOLI_ADMIN_LOGIN: "admin"
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
DOLI_ADMIN_PASSWORD: "${DOLI_ADMIN_PASSWORD:-12345678}"
|
2025-12-29 15:37:45 +00:00
|
|
|
DOLI_URL_ROOT: "http://localhost"
|
|
|
|
|
ports:
|
|
|
|
|
- "80:80"
|
|
|
|
|
volumes:
|
|
|
|
|
- dolibarr_documents:/var/www/documents
|
|
|
|
|
- dolibarr_custom:/var/www/html/custom
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"]
|
|
|
|
|
interval: 15s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 10
|
|
|
|
|
start_period: 30s
|
2025-12-29 15:37:45 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
dolimiddlewareapi:
|
|
|
|
|
image: dolimiddlewareapi
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: DoliMiddlewareApi/Dockerfile
|
|
|
|
|
container_name: dolibarr-middleware-api
|
|
|
|
|
depends_on:
|
|
|
|
|
dolibarr:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
ports:
|
2026-05-15 18:19:29 +00:00
|
|
|
- "5001:8080"
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
environment:
|
|
|
|
|
- ASPNETCORE_ENVIRONMENT=Production
|
|
|
|
|
- Jwt__Secret=DevDemoSecretKeyForDockerCompose2026Min32Chars!!
|
|
|
|
|
- Dolibarr__ApiUrl=http://dolibarr/api/index.php
|
2026-05-29 14:35:17 +00:00
|
|
|
volumes:
|
|
|
|
|
- bff_data:/app/data
|
feat: configure Swagger Bearer auth, fix CORS, Docker and deployment
- Program.cs: added Swagger with JWT Bearer security definition using
OpenApi v2 API (OpenApiSecuritySchemeReference), enabled Swagger in all
environments (not just Development), registered all new services
(ContactService, SetupService) in DI
- CORS: configurable via Cors__AllowedOrigins env var, allows all
when empty (dev-friendly)
- DoliMiddlewareApi.csproj: removed Microsoft.AspNetCore.OpenApi (conflicts
with Swashbuckle v10), kept Swashbuckle.AspNetCore 10.1.0
- appsettings.json: fixed Dolibarr ApiUrl to /api/index.php (was /explorer)
- compose.yaml: fixed Dolibarr ApiUrl, added JWT_SECRET default for dev,
added healthcheck for Dolibarr container, BFF waits for Dolibarr healthy
- .dockerignore: added to keep Docker build clean
- .env.example: template with instructions for JWT_SECRET
2026-05-15 16:58:43 +00:00
|
|
|
restart: unless-stopped
|
2025-12-29 15:37:45 +00:00
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
mysql_data:
|
|
|
|
|
dolibarr_documents:
|
2026-05-29 14:35:17 +00:00
|
|
|
dolibarr_custom:
|
|
|
|
|
bff_data:
|