Skip to content

Commit 9e4a1db

Browse files
committed
build fixups
1 parent e87c474 commit 9e4a1db

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Dockerfile
66
.dockerignore
77
Makefile
88
.github
9-
.git
9+
.git
10+
.yarn

Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ ARG NODE_VERSION=lts
33
FROM node:$NODE_VERSION-alpine AS builder
44
ENV YARN_CACHE_FOLDER=/opt/yarncache
55
WORKDIR /opt/app
6-
COPY package.json yarn.lock .yarnrc.yml .yarn/ ./
6+
7+
# Copy only the necessary files for Yarn
8+
COPY .yarnrc.yml package.json yarn.lock ./
9+
710
RUN corepack enable && yarn install --immutable
811
# patch logging for requestHandler
912
RUN sed -Ei \
@@ -13,7 +16,7 @@ RUN sed -Ei \
1316

1417
ENV NODE_ENV=production
1518
ENV NEXT_TELEMETRY_DISABLED=1
16-
ENV VLLM_URL="http://localhost:8000"
19+
ENV VLLM_URL=""
1720
ENV VLLM_API_KEY=""
1821

1922
COPY . .
@@ -23,8 +26,8 @@ RUN yarn build
2326
FROM node:$NODE_VERSION-alpine AS runner
2427
WORKDIR /opt/app
2528

26-
ENV NODE_ENV production
27-
ENV NEXT_TELEMETRY_DISABLED 1
29+
ENV NODE_ENV=production
30+
ENV NEXT_TELEMETRY_DISABLED=1
2831

2932
RUN addgroup --system --gid 1001 nodejs
3033
RUN adduser --system --uid 1001 nextjs
@@ -40,17 +43,16 @@ RUN chown nextjs:nodejs .next
4043
COPY --from=builder --chown=nextjs:nodejs /opt/app/.next/standalone ./
4144
COPY --from=builder --chown=nextjs:nodejs /opt/app/.next/static ./.next/static
4245

43-
# Copy Yarn Berry files for runtime (if needed for PnP or CLI usage)
46+
# Copy only the necessary files for runtime
4447
COPY --from=builder /opt/app/.yarnrc.yml ./
45-
COPY --from=builder /opt/app/.yarn ./.yarn
4648
COPY --from=builder /opt/app/package.json ./
4749
COPY --from=builder /opt/app/yarn.lock ./
4850

4951
USER nextjs
5052

5153
EXPOSE 3000
5254

53-
ENV PORT 3000
55+
ENV PORT=3000
5456
# set hostname to localhost
55-
ENV HOSTNAME "0.0.0.0"
57+
ENV HOSTNAME="0.0.0.0"
5658
CMD ["node", "server.js"]

0 commit comments

Comments
 (0)