Skip to content

Commit

Permalink
Merge pull request #1567 from IFRCGo/fix/docker-image-issue
Browse files Browse the repository at this point in the history
Add patches while installing packages
  • Loading branch information
samshara authored Dec 3, 2024
2 parents 4c7e925 + 5d76052 commit cbe00a9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions nginx-serve/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1-labs

FROM node:18-bullseye AS runtime
# -------------------------- Dev ---------------------------------------
FROM node:18-bullseye AS dev

RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
Expand All @@ -9,18 +10,24 @@ RUN apt-get update -y \

RUN npm install -g pnpm

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /code

RUN git config --global --add safe.directory /code

# ------------------------------------------------------------------------------------
FROM runtime AS nginx-build
# -------------------------- Nginx - Builder --------------------------------
FROM dev AS nginx-build

# NOTE: --parents is not yet available in stable syntax, using docker/dockerfile:1-labs
COPY --parents package.json pnpm-lock.yaml ./**/package.json /code/
COPY --parents package.json pnpm-lock.yaml pnpm-workspace.yaml ./**/package.json patches/ /code/

RUN pnpm install

COPY . /code/

# Dynamic configs. Can be changed with containers. (Placeholder values)
ENV APP_TITLE=APP_TITLE_PLACEHOLDER
ENV APP_ENVIRONMENT=APP_ENVIRONMENT_PLACEHOLDER
Expand All @@ -38,11 +45,9 @@ ENV APP_SENTRY_REPLAYS_SESSION_SAMPLE_RATE=${APP_SENTRY_REPLAYS_SESSION_SAMPLE_R
ARG APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=
ENV APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=${APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE}

COPY . /code/

RUN pnpm build

# ------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------
FROM nginx:1 AS nginx-serve

LABEL maintainer="IFRC"
Expand Down

0 comments on commit cbe00a9

Please sign in to comment.