-
Notifications
You must be signed in to change notification settings - Fork 63
/
Dockerfile
47 lines (32 loc) · 984 Bytes
/
Dockerfile
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
42
43
44
45
46
47
# Stage 1: Base image with Node.js and pnpm
FROM node:20.9.0-alpine AS base
# Install pnpm
RUN npm install -g pnpm
# Set working directory
WORKDIR /app
# Copy package.json, pnpm-lock.yaml, and .nvmrc
COPY package.json pnpm-lock.yaml .nvmrc ./
# Copy patches directory if it exists
COPY patches ./patches
# Install dependencies, including applying patches
RUN pnpm install --frozen-lockfile
# Copy the rest of the source code
COPY . .
# Stage 2: Final stage
FROM base AS final
# Install zip utility and bash
RUN apk add --no-cache zip bash
# Set working directory
WORKDIR /extension
# Copy all files from base
COPY --from=base /app ./
# Copy the entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
# Make the entrypoint script executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expose port for HMR
EXPOSE 5173
# Set the entrypoint to our new script
ENTRYPOINT ["docker-entrypoint.sh"]
# Set the default command (which can be overridden)
CMD ["build"]