From 3e9a0ca97856c3dad5877dbe0d6841f4b0879e6f Mon Sep 17 00:00:00 2001 From: gabdevele Date: Wed, 10 Jun 2026 23:00:28 +0200 Subject: [PATCH] Fix Dokploy compose --- README.md | 14 ++++++++++++ docker-compose.dev.yml | 49 ++++++++++++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 13cda15..377d7fa 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index ff8e9e3..d77bc7a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -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: \ No newline at end of file + mysql-data: + uploads-data: + +networks: + visione: + dokploy-network: + external: true