-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
6 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,17 @@ | ||
# Use a specific version of node | ||
FROM node:20-slim AS base | ||
|
||
# Set environment variables | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
# Enable corepack to use pnpm | ||
RUN corepack enable | ||
|
||
# Set the working directory in the container | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
# Copy package.json and pnpm-lock.yaml (or package-lock.json/yarn.lock) | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Install stage | ||
FROM base AS install | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
# The cache mount is used to cache the pnpm store | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install @radix-ui/react-alert-dialog | ||
|
||
# Final stage | ||
FROM base | ||
|
||
# Copy installed node_modules from the install stage | ||
COPY --from=install /app/node_modules /app/node_modules | ||
|
||
# Copy the rest of your app's source code from your host to your image filesystem. | ||
COPY . . | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
# The command to run your application | ||
CMD [ "pnpm", "run", "dev" ] | ||
CMD [ "pnpm", "run", "dev" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters