forked from karmada-io/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 794 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (24 loc) · 794 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
# Stage 1: Build Stage.
FROM node:18-alpine AS build
# Set working directory.
WORKDIR /app
# Copy package.json and package-lock.json to the container.
COPY package.json package-lock.json ./
# Install dependencies and browser-sync globally.
RUN npm install && npm install -g browser-sync
# Copy the rest of the application files.
COPY . .
# Stage 2: Development Stage.
FROM alpine:3.21.3
# Install yarn in the final image required to run the application.
RUN apk add --no-cache yarn
# Set working directory.
WORKDIR /app
# Copy only necessary files from the build stage (node_modules and app files).
COPY --from=build /app /app
# Set environment variable.
ENV NODE_ENV=development
# Expose port 3000.
EXPOSE 3000
# Start the application using yarn.
CMD ["yarn", "run", "start:watch"]