mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 11:39:26 +01:00
feat: Add Windows Docker Desktop support for local development
- Detect Windows platform and use named pipe (//./pipe/docker_engine) instead of Unix socket for Docker Desktop compatibility - Add NOMAD_STORAGE_PATH environment variable for configurable storage paths across different platforms - Update seeder to use environment variable with Linux default - Document new environment variable in .env.example This enables local development on Windows machines with Docker Desktop while maintaining Linux production compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
15aa1f3598
commit
d86c78dba5
|
|
@ -10,3 +10,9 @@ DB_USER=root
|
|||
DB_DATABASE=nomad
|
||||
DB_PASSWORD=password
|
||||
DB_SSL=false
|
||||
REDIS_HOST=localhost
|
||||
REDIS_PORT=6379
|
||||
# Storage path for NOMAD content (ZIM files, maps, etc.)
|
||||
# On Windows dev, use an absolute path like: C:/nomad-storage
|
||||
# On Linux production, use: /opt/project-nomad/storage
|
||||
NOMAD_STORAGE_PATH=/opt/project-nomad/storage
|
||||
|
|
@ -19,8 +19,16 @@ export class DockerService {
|
|||
public static KOLIBRI_SERVICE_NAME = 'nomad_kolibri'
|
||||
|
||||
constructor() {
|
||||
// Support both Linux (production) and Windows (development with Docker Desktop)
|
||||
const isWindows = process.platform === 'win32'
|
||||
if (isWindows) {
|
||||
// Windows Docker Desktop uses named pipe
|
||||
this.docker = new Docker({ socketPath: '//./pipe/docker_engine' })
|
||||
} else {
|
||||
// Linux uses Unix socket
|
||||
this.docker = new Docker({ socketPath: '/var/run/docker.sock' })
|
||||
}
|
||||
}
|
||||
|
||||
async affectContainer(
|
||||
serviceName: string,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ import Service from '#models/service'
|
|||
import { DockerService } from '#services/docker_service'
|
||||
import { BaseSeeder } from '@adonisjs/lucid/seeders'
|
||||
import { ModelAttributes } from '@adonisjs/lucid/types/model'
|
||||
import env from '#start/env'
|
||||
|
||||
export default class ServiceSeeder extends BaseSeeder {
|
||||
private static NOMAD_STORAGE_ABS_PATH = '/opt/project-nomad/storage'
|
||||
// Use environment variable with fallback to production default
|
||||
private static NOMAD_STORAGE_ABS_PATH = env.get('NOMAD_STORAGE_PATH', '/opt/project-nomad/storage')
|
||||
private static DEFAULT_SERVICES: Omit<ModelAttributes<Service>, 'created_at' | 'updated_at' | 'metadata' | 'id'>[] = [
|
||||
{
|
||||
service_name: DockerService.KIWIX_SERVICE_NAME,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user