mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
- Added new scripts for server development and full application startup in package.json. - Enhanced project management by checking for existing projects to avoid duplicates. - Improved API integration with better error handling and connection checks in the Electron API. - Updated UI components to reflect changes in project and session management. - Refactored authentication status display to include more detailed information on methods used.
56 lines
1.2 KiB
Docker
56 lines
1.2 KiB
Docker
# Automaker Backend Server
|
|
# Multi-stage build for minimal production image
|
|
|
|
# Build stage
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
COPY apps/server/package*.json ./apps/server/
|
|
|
|
# Install dependencies
|
|
RUN npm ci --workspace=apps/server
|
|
|
|
# Copy source
|
|
COPY apps/server ./apps/server
|
|
|
|
# Build TypeScript
|
|
RUN npm run build --workspace=apps/server
|
|
|
|
# Production stage
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S automaker && \
|
|
adduser -S automaker -u 1001
|
|
|
|
# Copy built files and production dependencies
|
|
COPY --from=builder /app/apps/server/dist ./dist
|
|
COPY --from=builder /app/apps/server/package*.json ./
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /data && chown automaker:automaker /data
|
|
|
|
# Switch to non-root user
|
|
USER automaker
|
|
|
|
# Environment variables
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3008
|
|
ENV DATA_DIR=/data
|
|
|
|
# Expose port
|
|
EXPOSE 3008
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3008/api/health || exit 1
|
|
|
|
# Start server
|
|
CMD ["node", "dist/index.js"]
|