Initial commit: Phase 1 scaffolding complete
- Root package.json with concurrently for dev server - Client: Vite + React 18 with design tokens and proxy config - Server: Express with CORS, multer (20MB), Sharp resize - Upload endpoint with preview generation - Dockerfile (multi-stage) and docker-compose.yml - Canvas deferred to Phase 8 (export functionality) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
48
Dockerfile
Normal file
48
Dockerfile
Normal file
@@ -0,0 +1,48 @@
|
||||
# Stage 1: Build client
|
||||
FROM node:20-alpine AS client-builder
|
||||
|
||||
WORKDIR /app/client
|
||||
|
||||
COPY client/package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY client/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Production server
|
||||
FROM node:20-alpine
|
||||
|
||||
# Install system dependencies for node-canvas and sharp
|
||||
RUN apk add --no-cache \
|
||||
cairo-dev \
|
||||
pango-dev \
|
||||
libjpeg-turbo-dev \
|
||||
giflib-dev \
|
||||
librsvg-dev \
|
||||
pixman-dev \
|
||||
python3 \
|
||||
make \
|
||||
g++
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy server package files and install
|
||||
COPY server/package*.json ./server/
|
||||
RUN cd server && npm install --production
|
||||
|
||||
# Copy server source
|
||||
COPY server/ ./server/
|
||||
|
||||
# Copy built client from builder
|
||||
COPY --from=client-builder /app/client/dist ./server/dist
|
||||
|
||||
# Create data directories
|
||||
RUN mkdir -p /app/server/uploads /app/server/exports
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3001/api/health || exit 1
|
||||
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["node", "server/index.js"]
|
||||
Reference in New Issue
Block a user