Rainnny7
791f88e11b
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 36s
46 lines
1.2 KiB
Docker
46 lines
1.2 KiB
Docker
FROM fascinated/docker-images:nodejs_20_with_yarn AS base
|
|
|
|
|
|
# Install dependencies
|
|
FROM base AS depends
|
|
WORKDIR /usr/src/app
|
|
COPY package.json* yarn.lock* ./
|
|
RUN yarn install --frozen-lockfile --quiet
|
|
|
|
|
|
# Build the app
|
|
FROM base AS builder
|
|
WORKDIR /usr/src/app
|
|
COPY --from=depends /usr/src/app/node_modules ./node_modules
|
|
COPY . .
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
RUN yarn run build
|
|
|
|
|
|
# Run the app
|
|
FROM base AS runner
|
|
WORKDIR /usr/src/app
|
|
|
|
RUN addgroup --system --gid 1001 nextjs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
RUN mkdir .next
|
|
RUN chown nextjs:nextjs .next
|
|
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/node_modules ./node_modules
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/.next ./.next
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/public ./public
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/docs ./docs
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/next.config.mjs ./next.config.mjs
|
|
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/package.json ./package.json
|
|
|
|
ENV NODE_ENV production
|
|
|
|
# Exposting on port 80 so we can
|
|
# access via a reverse proxy for Dokku
|
|
ENV HOSTNAME "0.0.0.0"
|
|
EXPOSE 80
|
|
ENV PORT 80
|
|
|
|
USER nextjs
|
|
CMD ["yarn", "start"] |