Skip to content

Commit

Permalink
use single build
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinature committed May 20, 2024
1 parent 7c3c93f commit 715801b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 515 deletions.
32 changes: 7 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,29 @@


FROM node:20.11.0-alpine3.19 as base

# RUN apk add --no-cache g++ make py3-pip libc6-compat
RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/[email protected] && \
echo 'https://packages.doppler.com/public/cli/alpine/any-version/main' | tee -a /etc/apk/repositories && \
apk add doppler

WORKDIR /app
EXPOSE 3000

COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build



FROM base as builder
WORKDIR /app
COPY . .
COPY --from=base /app/node_modules ./node_modules
RUN npm run build



FROM builder as production
WORKDIR /app

RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/[email protected] && \
echo 'https://packages.doppler.com/public/cli/alpine/any-version/main' | tee -a /etc/apk/repositories && \
apk add doppler

ENV NODE_ENV=production

# RUN addgroup -g 1001 -S nodejs
# RUN adduser -S nextjs -u 1001
# USER nextjs


# COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
# COPY --from=builder /app/.next ./.next
# COPY --from=builder /app/node_modules ./node_modules
# COPY --from=builder /app/package.json ./package.json
# COPY --from=builder /app/public ./public
COPY . .
CMD ["sh", "scripts/start-prod"]


CMD ["sh", "scripts/start-prod"]


# FROM base as dev
Expand Down
Loading

0 comments on commit 715801b

Please sign in to comment.