Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions db/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- Ensure app DB user has SYSTEM_USER dynamic privilege
GRANT SYSTEM_USER ON *.* TO 'mysql_user'@'%';
FLUSH PRIVILEGES;

-- ============================================================
-- Table: migrations
-- Stores migration history
Expand Down
44 changes: 44 additions & 0 deletions db/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "3"

# Standalone MySQL + phpMyAdmin, meant to be deployed on its own (not
# bundled into an app's stack) and shared across every app that needs it.
# Each app gets its own database + dedicated user created on this one
# server (see README below) and reaches it over the `dokploy-network`
# external network.
Comment on lines +3 to +7
services:
database:
container_name: database
restart: unless-stopped
build:
context: .
cap_add:
Comment on lines +12 to +14
- SYS_NICE
command: --mysql-native-password=ON
environment:
MYSQL_DATABASE: $MYSQL_DATABASE
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
volumes:
- "db_data:/var/lib/mysql"
networks:
- dokploy-network

phpmyadmin:
container_name: php-myadmin
restart: unless-stopped
depends_on:
- database
image: phpmyadmin
environment:
PMA_HOST: database
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
networks:
- dokploy-network

volumes:
db_data:

networks:
dokploy-network:
external: true
60 changes: 60 additions & 0 deletions docker-compose-dokploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "3.8"

# client+server only, pointed at an external shared MySQL (see
# db/docker-compose.yml) over Dokploy's dokploy-network. Mirrors
# docker-compose-swarm.yml but targets Dokploy instead of Coolify —
# that file's caddy/elknet/private-network/backend-network networks
# are Coolify-specific and don't exist under Dokploy, so it can't be
# reused as-is without breaking the deployment(s) that already rely
# on it.
services:
client:
image: 'ghcr.io/buzz-code/react-admin-nestjs-client:latest'
container_name: client
restart: unless-stopped
depends_on:
- server
healthcheck:
# 127.0.0.1, not localhost -- localhost resolution is
# unreliable in this image and silently fails the wget
# exec, which Traefik then reads as unhealthy and refuses
# to route to at all.
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:80/"]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
environment:
PORT: 80
REACT_APP_API_URL: 'https://api.$DOMAIN_NAME'
networks:
- dokploy-network

server:
image: 'ghcr.io/buzz-code/react-admin-nestjs-server:latest'
container_name: server
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
environment:
DOMAIN_NAME: $DOMAIN_NAME
MYSQL_HOST: $MYSQL_HOST
MYSQL_USER: $MYSQL_USER
MYSQL_PASSWORD: $MYSQL_PASSWORD
MYSQL_DATABASE: $MYSQL_DATABASE
JWT_SECRET: $JWT_SECRET
ADMIN_USER: $ADMIN_USER
SMTP_USER: $SMTP_USER
SMTP_PASSWORD: $SMTP_PASSWORD
MAINTENANCE_MODE: $MAINTENANCE_MODE
MAINTENANCE_MESSAGE: $MAINTENANCE_MESSAGE
networks:
- dokploy-network

networks:
dokploy-network:
external: true
Loading