Skip to content

Commit 64da3d4

Browse files
committed
try
1 parent 446ce72 commit 64da3d4

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

apps/web/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ node_modules
77
coverage
88

99
# Next.js
10-
.next
10+
.next/*
11+
!.next/standalone
1112
out
1213

1314
# Production

apps/web/buildspec.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,38 @@ phases:
5151
- ls -la .next/standalone/server.js || echo "❌ server.js not found"
5252

5353
- echo "=== BUILDING DOCKER IMAGE WITH BUILD ARTIFACTS ==="
54+
# Note: We're using a simplified runtime Dockerfile here because the build artifacts
55+
# are already created. For local development or standard CI/CD, use the main Dockerfile
56+
# which includes the full multi-stage build process.
5457
- |
5558
cat > Dockerfile.runtime << 'EOF'
56-
FROM public.ecr.aws/lambda/nodejs:18-x86_64
57-
WORKDIR /app
59+
# Use Node.js Alpine for smaller image size
60+
FROM node:18-alpine AS runtime
5861
59-
# Install unzip and Bun
60-
RUN yum update -y && yum install -y unzip && \
62+
# Install Bun
63+
RUN apk add --no-cache curl bash && \
6164
curl -fsSL https://bun.sh/install | bash && \
6265
ln -s /root/.bun/bin/bun /usr/local/bin/bun
6366
67+
WORKDIR /app
68+
6469
ENV NODE_ENV=production
6570
ENV NEXT_TELEMETRY_DISABLED=1
6671
ENV PORT=3000
6772
ENV HOSTNAME="0.0.0.0"
6873
69-
# Copy the complete standalone build (includes server.js, dependencies, static files, and public files)
74+
# Copy the complete standalone build
7075
COPY .next/standalone ./
7176
77+
# Ensure proper permissions
78+
RUN addgroup -g 1001 -S nodejs && \
79+
adduser -S nextjs -u 1001 && \
80+
chown -R nextjs:nodejs /app
81+
82+
USER nextjs
83+
7284
EXPOSE 3000
85+
7386
CMD ["bun", "server.js"]
7487
EOF
7588

0 commit comments

Comments
 (0)