Skip to content

Commit

Permalink
Pin versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gruz0 committed Nov 20, 2024
1 parent e6ef4a3 commit 77731c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG NODE_VERSION="node:22.11.0"
ARG ALPINE_VERSION="alpine3.20"
ARG NODE_VERSION="22.11.0"
ARG ALPINE_VERSION="3.20"
ARG NPM_SHARP_VERSION="0.33.5"

# Install dependencies only when needed
FROM "${NODE_VERSION}-${ALPINE_VERSION}" AS base
FROM node:"${NODE_VERSION}"-alpine"${ALPINE_VERSION}" AS base

WORKDIR /app

Expand All @@ -12,7 +12,7 @@ COPY package.json package-lock.json ./
RUN npm install "sharp@${NPM_SHARP_VERSION}" && npm ci

# Rebuild the source code only when needed
FROM "${NODE_VERSION}-${ALPINE_VERSION}" AS builder
FROM node:"${NODE_VERSION}"-alpine"${ALPINE_VERSION}" AS builder
WORKDIR /app

COPY --from=base /app/node_modules ./node_modules
Expand Down Expand Up @@ -57,7 +57,7 @@ ENV FEEDBACK_SERVICE_API_BASE=$FEEDBACK_SERVICE_API_BASE

RUN npm run build

FROM "${NODE_VERSION}-${ALPINE_VERSION}" AS prod_builder
FROM node:"${NODE_VERSION}"-alpine"${ALPINE_VERSION}" AS prod_builder
WORKDIR /app

ENV NODE_ENV production
Expand All @@ -68,7 +68,7 @@ COPY . .
RUN npm install && cp -R node_modules prod_node_modules

# Production image, copy all the files and run next
FROM "${NODE_VERSION}-${ALPINE_VERSION}" AS runner
FROM node:"${NODE_VERSION}"-alpine"${ALPINE_VERSION}" AS runner

WORKDIR /app

Expand Down

0 comments on commit 77731c6

Please sign in to comment.