Skip to content

Commit

Permalink
cicd: update dockerfile build target logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-1337 committed Jan 22, 2025
1 parent da41920 commit 0b5878c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Declare the build argument at the top
ARG BUILD_TARGET=main-chain

FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
Expand Down Expand Up @@ -26,5 +29,12 @@ WORKDIR /workspace/apps/proxy-chain
CMD ["pnpm", "--filter", "@joincolony/proxy-chain", "prod"]

# Final stage that will be used
FROM ${BUILD_TARGET:-main-chain} AS final
FROM ${BUILD_TARGET} AS final

# Add labels and echo build info
LABEL build_type=${BUILD_TARGET}
RUN echo "🏗️ Building ${BUILD_TARGET} version of block-ingestor" && \
echo "📦 Final build target: ${BUILD_TARGET}"

# Keep existing CMD from the selected stage

0 comments on commit 0b5878c

Please sign in to comment.