Fix Dokploy compose
This commit is contained in:
@@ -131,6 +131,20 @@ ctest --test-dir build --output-on-failure
|
|||||||
The `RequestLogger` plugin logs every response as method, path, status and
|
The `RequestLogger` plugin logs every response as method, path, status and
|
||||||
client address.
|
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
|
## Current Endpoints
|
||||||
|
|
||||||
- `GET /api/v1/health`: process health check, no external dependency.
|
- `GET /api/v1/health`: process health check, no external dependency.
|
||||||
|
|||||||
+32
-15
@@ -3,33 +3,41 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
restart: unless-stopped
|
||||||
- "${BACKEND_PORT:-5555}:5555"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/app/config.json
|
- ../files/config.json:/app/config.json:ro
|
||||||
|
- uploads-data:/app/uploads
|
||||||
environment:
|
environment:
|
||||||
- DB_HOST=mysql
|
DB_HOST: ${DB_HOST:-mysql}
|
||||||
- DB_PORT=3306
|
DB_PORT: ${DB_PORT:-3306}
|
||||||
- DB_USER=${MYSQL_USER:-visione}
|
DB_USER: ${MYSQL_USER:-visione}
|
||||||
- DB_PASSWORD=${MYSQL_PASSWORD:-visione}
|
DB_PASSWORD: ${MYSQL_PASSWORD:-visione}
|
||||||
- DB_NAME=${MYSQL_DATABASE:-visione}
|
DB_NAME: ${MYSQL_DATABASE:-visione}
|
||||||
- SMTP_HOST=mailhog
|
SMTP_HOST: ${SMTP_HOST:-mailhog}
|
||||||
- SMTP_PORT=1025
|
SMTP_PORT: ${SMTP_PORT:-1025}
|
||||||
|
expose:
|
||||||
|
- "5555"
|
||||||
|
networks:
|
||||||
|
- visione
|
||||||
|
- dokploy-network
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.4
|
image: mysql:8.4
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-root}"
|
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-root}"
|
||||||
MYSQL_DATABASE: "${MYSQL_DATABASE:-visione}"
|
MYSQL_DATABASE: "${MYSQL_DATABASE:-visione}"
|
||||||
MYSQL_USER: "${MYSQL_USER:-visione}"
|
MYSQL_USER: "${MYSQL_USER:-visione}"
|
||||||
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-visione}"
|
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-visione}"
|
||||||
ports:
|
expose:
|
||||||
- "${MYSQL_PORT:-3306}:3306"
|
- "3306"
|
||||||
volumes:
|
volumes:
|
||||||
- mysql-data:/var/lib/mysql
|
- mysql-data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- visione
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} --silent"]
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} --silent"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
@@ -39,9 +47,18 @@ services:
|
|||||||
|
|
||||||
mailhog:
|
mailhog:
|
||||||
image: mailhog/mailhog:v1.0.1
|
image: mailhog/mailhog:v1.0.1
|
||||||
ports:
|
restart: unless-stopped
|
||||||
- "${MAILHOG_SMTP_PORT:-1025}:1025"
|
expose:
|
||||||
- "${MAILHOG_WEB_PORT:-8025}:8025"
|
- "1025"
|
||||||
|
- "8025"
|
||||||
|
networks:
|
||||||
|
- visione
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
|
uploads-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
visione:
|
||||||
|
dokploy-network:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user