Skip to content

Commit

Permalink
Merge pull request #55 from ms-club-sliit/stargazer39-patch-3
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
stargazer39 authored Aug 13, 2024
2 parents 6c3faf2 + 9abcc62 commit 50b992a
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ FROM base AS deps
RUN apk add --no-cache libc6-compat git
# Define build arguments

ARG NEXT_PUBLIC_FIREBASE_API_KEY
ARG NEXT_PUBLIC_AUTH_DOMAIN
ARG NEXT_PUBLIC_PROJECT_ID
ARG NEXT_PUBLIC_STORAGE_BUCKET
ARG NEXT_PUBLIC_MESSAGING_SENDER_ID
ARG NEXT_PUBLIC_APP_ID
ARG NEXT_PUBLIC_MEASUREMENT_ID
ARG NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX
ARG NEXT_PUBLIC_EMAIL_ENDPOINT

# Setup pnpm environment
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
Expand All @@ -40,6 +30,16 @@ WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

ARG NEXT_PUBLIC_FIREBASE_API_KEY
ARG NEXT_PUBLIC_AUTH_DOMAIN
ARG NEXT_PUBLIC_PROJECT_ID
ARG NEXT_PUBLIC_STORAGE_BUCKET
ARG NEXT_PUBLIC_MESSAGING_SENDER_ID
ARG NEXT_PUBLIC_APP_ID
ARG NEXT_PUBLIC_MEASUREMENT_ID
ARG NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX
ARG NEXT_PUBLIC_EMAIL_ENDPOINT

ENV NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
ENV NEXT_PUBLIC_AUTH_DOMAIN=${NEXT_PUBLIC_AUTH_DOMAIN}
ENV NEXT_PUBLIC_PROJECT_ID=${NEXT_PUBLIC_PROJECT_ID}
Expand All @@ -50,6 +50,8 @@ ENV NEXT_PUBLIC_MEASUREMENT_ID=${NEXT_PUBLIC_MEASUREMENT_ID}
ENV NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX=${NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX}
ENV NEXT_PUBLIC_EMAIL_ENDPOINT=${NEXT_PUBLIC_EMAIL_ENDPOINT}

RUN echo "Test $NEXT_PUBLIC_AUTH_DOMAIN"

RUN pnpm build


Expand All @@ -63,6 +65,16 @@ ENV NODE_ENV production
# Learn more here: https://nextjs.org/telemetry
ENV NEXT_TELEMETRY_DISABLED 1

ARG NEXT_PUBLIC_FIREBASE_API_KEY
ARG NEXT_PUBLIC_AUTH_DOMAIN
ARG NEXT_PUBLIC_PROJECT_ID
ARG NEXT_PUBLIC_STORAGE_BUCKET
ARG NEXT_PUBLIC_MESSAGING_SENDER_ID
ARG NEXT_PUBLIC_APP_ID
ARG NEXT_PUBLIC_MEASUREMENT_ID
ARG NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX
ARG NEXT_PUBLIC_EMAIL_ENDPOINT

ENV NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
ENV NEXT_PUBLIC_AUTH_DOMAIN=${NEXT_PUBLIC_AUTH_DOMAIN}
ENV NEXT_PUBLIC_PROJECT_ID=${NEXT_PUBLIC_PROJECT_ID}
Expand All @@ -73,6 +85,8 @@ ENV NEXT_PUBLIC_MEASUREMENT_ID=${NEXT_PUBLIC_MEASUREMENT_ID}
ENV NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX=${NEXT_PUBLIC_FIREBASE_COLLECTION_PREFIX}
ENV NEXT_PUBLIC_EMAIL_ENDPOINT=${NEXT_PUBLIC_EMAIL_ENDPOINT}

RUN echo "Test $NEXT_PUBLIC_AUTH_DOMAIN"

# Set correct permissions for nextjs user and don't run as root
RUN addgroup nodejs
RUN adduser -SDH nextjs
Expand Down

0 comments on commit 50b992a

Please sign in to comment.