chore: update Docker configuration and entrypoint script

- Enhanced .dockerignore to exclude additional build outputs and dependencies.
- Modified dev.mjs and start.mjs to change Docker container startup behavior, removing the --build flag to preserve volumes.
- Updated docker-compose.yml to add a new volume for persisting Claude CLI OAuth session keys.
- Introduced docker-entrypoint.sh to fix permissions on the Claude CLI config directory.
- Adjusted Dockerfile to include the entrypoint script and ensure proper user permissions.

These changes improve the Docker setup and streamline the development workflow.
This commit is contained in:
webdevcody
2026-01-05 10:44:47 -05:00
parent abab7be367
commit aca84fe16a
8 changed files with 94 additions and 16 deletions

View File

@@ -7,12 +7,28 @@ import { createLogger } from '@automaker/utils/logger';
import { getHttpApiClient } from './http-api-client';
import { getElectronAPI } from './electron';
import { getItem, setItem } from './storage';
import path from 'path';
const logger = createLogger('WorkspaceConfig');
const LAST_PROJECT_DIR_KEY = 'automaker:lastProjectDir';
/**
* Browser-compatible path join utility
* Works in both Node.js and browser environments
*/
function joinPath(...parts: string[]): string {
// Remove empty parts and normalize separators
const normalized = parts
.filter((p) => p)
.map((p) => p.replace(/\\/g, '/'))
.join('/')
.replace(/\/+/g, '/'); // Remove duplicate slashes
// Preserve leading slash if first part had it
const hasLeadingSlash = parts[0]?.startsWith('/');
return hasLeadingSlash ? '/' + normalized.replace(/^\//, '') : normalized;
}
/**
* Gets the default Documents/Automaker directory path
* @returns Promise resolving to Documents/Automaker path, or null if unavailable
@@ -21,7 +37,7 @@ async function getDefaultDocumentsPath(): Promise<string | null> {
try {
const api = getElectronAPI();
const documentsPath = await api.getPath('documents');
return path.join(documentsPath, 'Automaker');
return joinPath(documentsPath, 'Automaker');
} catch (error) {
logger.error('Failed to get documents path:', error);
return null;