change local to dev
This commit is contained in:
@@ -5,20 +5,34 @@ RUN apk add --no-cache libc6-compat
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy dependency files first
|
# Copy dependency files first (better layer caching - reinstall only when package.json changes)
|
||||||
COPY sistem-km-next/package*.json ./
|
COPY sistem-km-next/package*.json ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install all dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy the rest of the application files
|
# Copy the rest of the application source files
|
||||||
COPY sistem-km-next/ .
|
COPY sistem-km-next/ .
|
||||||
|
|
||||||
|
# --- Build-time environment variables ---
|
||||||
|
# Next.js bakes NEXT_PUBLIC_* variables into the client-side JavaScript bundle
|
||||||
|
# at BUILD TIME (not runtime), so they must be available here as ENV vars.
|
||||||
|
# Coolify automatically injects these as Docker build args from the environment section.
|
||||||
|
ARG NEXT_PUBLIC_SUPABASE_URL
|
||||||
|
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
|
||||||
|
ARG SUPABASE_SERVICE_ROLE_KEY
|
||||||
|
ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL
|
||||||
|
ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY
|
||||||
|
ENV SUPABASE_SERVICE_ROLE_KEY=$SUPABASE_SERVICE_ROLE_KEY
|
||||||
|
|
||||||
|
# Build the production Next.js bundle
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
# Expose Next.js port
|
# Expose Next.js port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME "0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
# Start Next.js app in development mode
|
# Start in production mode (no dev tools, no HMR, much faster)
|
||||||
CMD ["npm", "run", "dev"]
|
CMD ["npm", "run", "start"]
|
||||||
|
|||||||
Reference in New Issue
Block a user