-
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
1 parent
8cda564
commit f080ca6
Showing
2 changed files
with
23 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
.svelte-kit/ | ||
build/ |
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,16 +1,24 @@ | ||
FROM node:22-alpine AS builder | ||
# Step 1: Build the application | ||
FROM oven/bun AS builder | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
COPY package*.json . | ||
RUN npm ci | ||
|
||
# Copy all the application files to the container | ||
COPY . . | ||
RUN npm run build | ||
RUN npm prune --production | ||
|
||
FROM node:22-alpine | ||
WORKDIR /app | ||
COPY --from=builder /app/build build/ | ||
COPY --from=builder /app/node_modules node_modules/ | ||
COPY package.json . | ||
# Run your build process | ||
RUN bun i | ||
RUN bun run build | ||
|
||
# Step 2: Create a smaller image for running the application | ||
FROM oven/bun | ||
|
||
# Copy only the necessary files from the builder image to the final image | ||
COPY --from=builder /app/build . | ||
|
||
# Expose the port the application will run on | ||
EXPOSE 3000 | ||
ENV NODE_ENV=production | ||
CMD [ "node", "build" ] | ||
|
||
#Start the BUN server | ||
CMD ["bun", "run", "start"] |