feat: Initialize NxMesh project with Docker, Nginx, PostgreSQL, and Rust backend

- Add Docker Compose configuration for development environment
- Create Nginx configuration files for routing and health checks
- Set up PostgreSQL database with health checks
- Add .dockerignore and .gitignore files to exclude unnecessary files
- Initialize Cargo.toml and Cargo.lock for Rust dependencies
- Include GNU General Public License for project
- Add README.md for project description
- Create Justfile for development workflow commands
This commit is contained in:
2026-03-02 12:32:01 +00:00
parent 096f6d558d
commit 39bd860c55
14 changed files with 965 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
version: '3.8'
services:
# Development environment - Control Plane (Rust backend + Vite frontend)
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace:cached
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/nxmesh
- RUST_LOG=debug
- RUST_BACKTRACE=1
- NODE_ENV=development
ports:
- "3000:3000" # Vite dev server
- "8080:8080" # Rust backend (Control Plane)
depends_on:
postgres:
condition: service_healthy
command: sleep infinity
networks:
- nxmesh-network
group_add:
- docker
pid: "service:nginx"
# Data Plane - Nginx (controlled by agent via Docker)
nginx:
image: nginx:alpine
container_name: nxmesh-nginx
restart: unless-stopped
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
ports:
- "80:80"
- "443:443"
networks:
- nxmesh-network
# Database
postgres:
image: postgres:16-alpine
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nxmesh
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- nxmesh-network
volumes:
postgres-data:
networks:
nxmesh-network: