-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 781 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (28 loc) · 781 Bytes
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
FROM node:22-alpine AS base
RUN corepack enable yarn
# Stage 1: Install dependencies
FROM base AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Stage 2: Build the application
FROM base AS builder
WORKDIR /app
ARG ASSET_PREFIX
ENV ASSET_PREFIX=${ASSET_PREFIX}
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable yarn
RUN npx vsce pack --allow-missing-repository
RUN yarn run build:next
RUN yarn run patch:standalone
# Stage 3: Production server
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN apk add --no-cache aws-cli xwallpaper
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/*.vsix ./extension/
COPY --from=builder /app/upload.js ./
EXPOSE 3000
CMD ["node", "upload.js"]