Skip to content

Commit

Permalink
🐛 fix(docker): improve config to reduce unnecessary env and change de…
Browse files Browse the repository at this point in the history
…fault PORT (lobehub#298)
  • Loading branch information
arvinxx committed Oct 11, 2023
1 parent fc3f761 commit 6061318
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM node:20-slim AS base

## Install dependencies only when needed
FROM base AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

## Install dependencies only when needed
FROM base AS builder
WORKDIR /app

COPY package.json ./
Expand Down Expand Up @@ -39,7 +40,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000
EXPOSE 3210

# set hostname to localhost
ENV HOSTNAME "0.0.0.0"
Expand All @@ -48,4 +49,4 @@ ENV ACCESS_CODE "lobe66"
ENV OPENAI_API_KEY ""
ENV OPENAI_PROXY_URL ""

CMD ["node", "server.js"]
CMD ["PORT=3210","node", "server.js"]

0 comments on commit 6061318

Please sign in to comment.