Skip to content

Commit 5d76052

Browse files
committed
Fix issue with pnpm workspace
1 parent fa87917 commit 5d76052

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

nginx-serve/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# syntax=docker/dockerfile:1-labs
22

3-
FROM node:18-bullseye AS runtime
3+
# -------------------------- Dev ---------------------------------------
4+
FROM node:18-bullseye AS dev
45

56
RUN apt-get update -y \
67
&& apt-get install -y --no-install-recommends \
@@ -9,18 +10,24 @@ RUN apt-get update -y \
910

1011
RUN npm install -g pnpm
1112

13+
ENV PNPM_HOME="/pnpm"
14+
ENV PATH="$PNPM_HOME:$PATH"
15+
RUN corepack enable
16+
1217
WORKDIR /code
1318

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

16-
# ------------------------------------------------------------------------------------
17-
FROM runtime AS nginx-build
21+
# -------------------------- Nginx - Builder --------------------------------
22+
FROM dev AS nginx-build
1823

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

2227
RUN pnpm install
2328

29+
COPY . /code/
30+
2431
# Dynamic configs. Can be changed with containers. (Placeholder values)
2532
ENV APP_TITLE=APP_TITLE_PLACEHOLDER
2633
ENV APP_ENVIRONMENT=APP_ENVIRONMENT_PLACEHOLDER
@@ -38,11 +45,9 @@ ENV APP_SENTRY_REPLAYS_SESSION_SAMPLE_RATE=${APP_SENTRY_REPLAYS_SESSION_SAMPLE_R
3845
ARG APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=
3946
ENV APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=${APP_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE}
4047

41-
COPY . /code/
42-
4348
RUN pnpm build
4449

45-
# ------------------------------------------------------------------------------------
50+
# ---------------------------------------------------------------------------
4651
FROM nginx:1 AS nginx-serve
4752

4853
LABEL maintainer="IFRC"

0 commit comments

Comments
 (0)