feature/dockerfile #1

Merged
michelangelo merged 8 commits from feature/dockerfile into main 2026-06-10 21:35:40 +00:00
2 changed files with 47 additions and 16 deletions
Showing only changes of commit 3e9a0ca978 - Show all commits
+14
View File
@@ -131,6 +131,20 @@ ctest --test-dir build --output-on-failure
The `RequestLogger` plugin logs every response as method, path, status and
client address.
## Dokploy
Use `docker-compose.dev.yml` as the Dokploy compose path for a self-contained
backend deployment with MySQL and MailHog. Configure the public domain in
Dokploy against service `backend` and container port `5555`.
Before deploying, create an Advanced Mount named `config.json` in Dokploy and
paste the repository `config.json` content into it. The compose file mounts it
from `../files/config.json` so AutoDeploy does not depend on bind mounts from a
freshly cloned repository.
Set `MYSQL_PASSWORD`, `MYSQL_ROOT_PASSWORD` and any other environment-specific
values in Dokploy environment variables.
## Current Endpoints
- `GET /api/v1/health`: process health check, no external dependency.
+32 -15
View File
@@ -3,33 +3,41 @@ services:
build:
context: .
dockerfile: Dockerfile
ports:
- "${BACKEND_PORT:-5555}:5555"
restart: unless-stopped
volumes:
- ./config.json:/app/config.json
- ../files/config.json:/app/config.json:ro
- uploads-data:/app/uploads
environment:
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=${MYSQL_USER:-visione}
- DB_PASSWORD=${MYSQL_PASSWORD:-visione}
- DB_NAME=${MYSQL_DATABASE:-visione}
- SMTP_HOST=mailhog
- SMTP_PORT=1025
DB_HOST: ${DB_HOST:-mysql}
DB_PORT: ${DB_PORT:-3306}
DB_USER: ${MYSQL_USER:-visione}
DB_PASSWORD: ${MYSQL_PASSWORD:-visione}
DB_NAME: ${MYSQL_DATABASE:-visione}
SMTP_HOST: ${SMTP_HOST:-mailhog}
SMTP_PORT: ${SMTP_PORT:-1025}
expose:
- "5555"
networks:
- visione
- dokploy-network
depends_on:
mysql:
condition: service_healthy
mysql:
image: mysql:8.4
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-root}"
MYSQL_DATABASE: "${MYSQL_DATABASE:-visione}"
MYSQL_USER: "${MYSQL_USER:-visione}"
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-visione}"
ports:
- "${MYSQL_PORT:-3306}:3306"
expose:
- "3306"
volumes:
- mysql-data:/var/lib/mysql
networks:
- visione
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} --silent"]
interval: 5s
@@ -39,9 +47,18 @@ services:
mailhog:
image: mailhog/mailhog:v1.0.1
ports:
- "${MAILHOG_SMTP_PORT:-1025}:1025"
- "${MAILHOG_WEB_PORT:-8025}:8025"
restart: unless-stopped
expose:
- "1025"
- "8025"
networks:
- visione
volumes:
mysql-data:
uploads-data:
networks:
visione:
dokploy-network:
external: true