forked from sparrowapp-dev/sparrow-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStorybook.Dockerfile
More file actions
41 lines (28 loc) · 912 Bytes
/
Storybook.Dockerfile
File metadata and controls
41 lines (28 loc) · 912 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
33
34
35
36
37
38
39
40
41
# Stage 1: Build
FROM node:20.8.1-alpine as builder
# Set the working directory
WORKDIR /app
ENV GENERATE_SOURCEMAP=false
# Copy root-level files
COPY package.json yarn.lock ./
# Copy packages folder
COPY packages ./packages
# Copy apps folder
COPY apps/@sparrow-storybook ./apps/@sparrow-storybook
# Install dependencies (using yarn to respect the workspace setup)
RUN yarn install --frozen-lockfile
# Build the web app
# WORKDIR /app/apps/@sparrow-storybook
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN yarn storybook-build
# Stage 2: Serve
FROM nginx:alpine as runner
# Set working directory in Nginx
WORKDIR /usr/share/nginx/html
# Copy build output from builder stage
COPY --from=builder /app/apps/@sparrow-storybook/dist /usr/share/nginx/html
COPY ./apps/@sparrow-storybook/nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]