Skip to content

Commit 6c37271

Browse files
committed
Refactor buildspec.yml to streamline Docker image creation
- Remove Bun installation steps from the Dockerfile for a cleaner build process. - Update user creation comment for clarity on security practices. - Maintain Node.js as the command for running the standalone server.
1 parent b1bfc4d commit 6c37271

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

apps/web/buildspec.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ phases:
5959
# Use Node.js Alpine for smaller image size
6060
FROM node:18-alpine AS runtime
6161
62-
# Install dependencies for Bun
63-
RUN apk add --no-cache curl bash
64-
6562
WORKDIR /app
6663
6764
ENV NODE_ENV=production
@@ -72,20 +69,16 @@ phases:
7269
# Copy the complete standalone build
7370
COPY .next/standalone ./
7471
75-
# Create user and set permissions
72+
# Create non-root user for security
7673
RUN addgroup -g 1001 -S nodejs && \
7774
adduser -S nextjs -u 1001 && \
7875
chown -R nextjs:nodejs /app
7976
80-
# Install Bun as the nextjs user in a globally accessible location
81-
RUN curl -fsSL https://bun.sh/install | bash -s -- --install-dir=/usr/local && \
82-
chmod +x /usr/local/bin/bun
83-
8477
USER nextjs
8578
8679
EXPOSE 3000
8780
88-
# Use node to run the standalone server.js directly
81+
# Use node to run the standalone server.js
8982
CMD ["node", "server.js"]
9083
EOF
9184

0 commit comments

Comments
 (0)