Simplify Dockerfile.dev user configuration
This commit is contained in:
parent
43083de965
commit
7a1a60cebc
@ -5,10 +5,6 @@ WORKDIR /app
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Add a non-root user
|
||||
RUN addgroup -g 1001 -S nodejs && \
|
||||
adduser -S nextjs -u 1001
|
||||
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
@ -16,11 +12,8 @@ COPY package.json pnpm-lock.yaml ./
|
||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# Switch to non-root user
|
||||
USER nextjs
|
||||
|
||||
# Copy source code
|
||||
COPY --chown=nextjs:nodejs . .
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
Loading…
Reference in New Issue
Block a user