You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
618 B
Docker

FROM node:16-alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
FROM node:16-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NODE_ENV production
RUN yarn build-storybook
FROM node:16-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 runner
COPY --from=builder /app/package.json ./package.json
COPY --from=builder --chown=runner:nodejs /app/storybook-static ./
RUN npm i -g http-server
USER runner
EXPOSE 5000
ENV PORT 5000
CMD ["http-server"]