Skip to content

Commit

Permalink
Update Dockerfile to alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallJoeMaher authored Nov 17, 2023
1 parent 9c87131 commit 5ec4b06
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Install dependencies only when needed
FROM public.ecr.aws/docker/library/node:18 AS base
FROM public.ecr.aws/docker/library/node:18-alpine AS base

# Install dependencies only when needed
FROM base AS deps

RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
Expand Down Expand Up @@ -31,7 +33,7 @@ RUN --mount=type=secret,id=TEST_VALUE export TEST_VALUE=$(cat /run/secrets/TEST_
RUN --mount=type=secret,id=SECRET_TIME export SECRET_TIME=$(cat /run/secrets/SECRET_TIME) && \
echo $SECRET_TIME

RUN --mount=type=secret,id=DATABASE_URL export DATABASE_URL=$(cat /run/secrets/DATABASE_URL) \
RUN --mount=type=secret,id=DATABASE_URL export DATABASE_URL=$(cat /run/secrets/DATABASE_URL) && \
npm run build

# Production image, copy all the files and run next
Expand All @@ -40,7 +42,7 @@ WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
Expand Down

0 comments on commit 5ec4b06

Please sign in to comment.