fix: review compose dev for clean startup

This commit is contained in:
Julien Froidefond
2025-10-07 17:26:30 +02:00
parent 4c676cfd16
commit 6f1889931c
5 changed files with 49 additions and 16 deletions

View File

@@ -1,6 +1,10 @@
# Build stage
FROM node:20-alpine AS builder
# Declare MONGODB_URI as an argument for the builder stage
ARG MONGODB_URI
ENV MONGODB_URI=$MONGODB_URI
# Set working directory
WORKDIR /app
@@ -14,8 +18,8 @@ RUN corepack enable
COPY package.json yarn.lock ./
# Copy configuration files
COPY tsconfig.json next-env.d.ts .eslintrc.json ./
COPY tailwind.config.ts postcss.config.js .env ./
COPY tsconfig.json .eslintrc.json ./
COPY tailwind.config.ts postcss.config.js ./
# Install dependencies with Yarn
RUN yarn install --frozen-lockfile
@@ -43,7 +47,6 @@ COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/next-env.d.ts ./
COPY --from=builder /app/tailwind.config.ts ./
COPY --from=builder /app/.env ./
# Add non-root user for security
RUN addgroup --system --gid 1001 nodejs && \