diff --git a/Dockerfile b/Dockerfile index 8c2bfa19..d5720782 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ FROM node:18-alpine ARG CACHE_BURST=1 -# Add build arguments for Supabase ARG NEXT_PUBLIC_SUPABASE_URL ARG NEXT_PUBLIC_SUPABASE_ANON_KEY -# Set environment variables -ENV NODE_ENV="production" \ +ENV NODE_ENV="development" \ NEXT_TELEMETRY_DISABLED=1 \ NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL \ NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY @@ -15,12 +13,19 @@ WORKDIR /app COPY package*.json ./ -RUN npm i +# Install ALL dependencies +RUN npm install -COPY ./ ./ +COPY . . RUN npm run build +# Switch to production after build +ENV NODE_ENV="production" + +# Clean up development dependencies +RUN npm prune --production + EXPOSE 3000 CMD ["npm", "start"]