Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
Bit-Barron committed Oct 28, 2024
1 parent 8cda564 commit f080ca6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.svelte-kit/
build/
32 changes: 20 additions & 12 deletions Dockerfile
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"]

0 comments on commit f080ca6

Please sign in to comment.