Skip to content

Commit

Permalink
Added image opti & port args to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cr4yfish committed Aug 12, 2023
1 parent f1de372 commit efccb3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM node:20-alpine AS build-env

ARG NEXT_PUBLIC_DEFAULT_INSTANCE
ARG PORT
ARG DISABLE_IMAGE_OPTIMIZATION

ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /app
Expand All @@ -18,9 +20,10 @@ FROM gcr.io/distroless/nodejs20-debian11:nonroot
WORKDIR /app

ENV NODE_ENV production
ENV PORT 3000
ENV PORT $PORT
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_PUBLIC_DEFAULT_INSTANCE=$NEXT_PUBLIC_DEFAULT_INSTANCE
ENV DISABLE_IMAGE_OPTIMIZATION=$DISABLE_IMAGE_OPTIMIZATION

COPY --from=build-env /app/next.config.js ./
COPY --from=build-env /app/.next /app/.next
Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const withPWA = require("next-pwa")({
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
unoptimized: process.env.DISABLE_IMAGE_OPTIMIZATION === "true",
minimumCacheTTL: 60,
remotePatterns: [
{
Expand Down

0 comments on commit efccb3d

Please sign in to comment.