Skip to content

Commit 8b21900

Browse files
committed
fix: should have an env set for the if to work
1 parent 5289131 commit 8b21900

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
ARG IMG=node:22.11-alpine3.19
22

3-
FROM $IMG as builder
4-
5-
# This should be set after the FROM to work
6-
ARG ENABLE_RABBITMQ=false
3+
FROM $IMG AS builder
74

85
WORKDIR /usr/src/app/
96

@@ -20,7 +17,7 @@ COPY config.js.docker ./src/config.js
2017

2118
RUN npm run build && npm run build-scripts
2219

23-
FROM $IMG as deps
20+
FROM $IMG AS deps
2421

2522
WORKDIR /usr/src/app/
2623
ENV NODE_ENV=production
@@ -33,6 +30,8 @@ RUN apk add --no-cache --virtual .gyp python3 make g++ &&\
3330
npm ci --only=production
3431

3532
# Install amqp library if RabbitMQ is enabled
33+
ARG ENABLE_RABBITMQ=false
34+
ENV ENABLE_RABBITMQ=${ENABLE_RABBITMQ}
3635
RUN if [ "$ENABLE_RABBITMQ" = "true" ]; then npm install amqplib@^0.10.5; fi
3736

3837
RUN apk del .gyp &&\

0 commit comments

Comments
 (0)