-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 686 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) · 686 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:lts-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
# Install Astro runtime dependencies
FROM base AS prod-deps
RUN pnpm install --prod --ignore-scripts --shamefully-hoist
# NOTE: Requires Astro build output before Docker build
FROM base AS build
# Copy Astro build output
COPY ./dist ./dist
# Production image
FROM node:lts-alpine
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
WORKDIR /app
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/ .
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
ENV NODE_ENV=production
CMD ["node", "./dist/server/entry.mjs"]