-
Notifications
You must be signed in to change notification settings - Fork 309
Expand file tree
/
Copy pathDockerfile.sync
More file actions
42 lines (33 loc) · 1.26 KB
/
Dockerfile.sync
File metadata and controls
42 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Dockerfile for standalone sync job
# This creates a lightweight container that only runs the sync service
# Use this for Kubernetes CronJobs or scheduled container instances
FROM node:24-alpine3.23 AS base
# Build stage - install all dependencies
FROM base AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Copy source code
COPY server ./server
COPY shared ./shared
COPY app/model ./app/model
COPY app/types ./app/types
COPY app/utils ./app/utils
COPY nuxt.config.ts tsconfig.json tsconfig.sync.json ./
# Production stage
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy package files and install ALL dependencies (including tsx for runtime)
COPY package.json package-lock.json ./
RUN npm ci
# Copy source files from builder
COPY --from=builder /app/server ./server
COPY --from=builder /app/shared ./shared
COPY --from=builder /app/app ./app
COPY --from=builder /app/nuxt.config.ts ./nuxt.config.ts
COPY --from=builder /app/tsconfig.json ./tsconfig.json
COPY --from=builder /app/tsconfig.sync.json ./tsconfig.sync.json
# Run sync entry point with tsx for TypeScript support
# Use tsconfig.sync.json which defines @/* path aliases (normally provided by Nuxt)
CMD ["npx", "tsx", "--tsconfig", "tsconfig.sync.json", "server/sync-entry.ts"]