Skip to content

Commit

Permalink
Merge pull request #90 from pedrolivaresanchez/feat/install-all-deps-…
Browse files Browse the repository at this point in the history
…on-build
  • Loading branch information
Ismaaa authored Nov 6, 2024
2 parents 5336f68 + 1fdaa8f commit 54ee716
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]

0 comments on commit 54ee716

Please sign in to comment.