build-tools/.github/repo-templates/d/actions-build.Dockerfile
2025-02-13 20:26:29 +05:30

30 lines
926 B
Docker

FROM repo2.hub.gmetri.io/gmetrivr/basin:node-22-dev-v2
#Remove old code
# RUN find . -maxdepth 1 ! \( -name node_modules -o -name .pnpm-store \) -exec rm -rf "{}" \;
#Replace with new code (node_modules and .pnpm_store are in dockerignore)
COPY --chown=1000:1000 . /src
#PUBLIC_BUILD_VERSION contains the unique build id for this image
ARG PUBLIC_BUILD_VERSION
ENV PUBLIC_BUILD_VERSION=$PUBLIC_BUILD_VERSION
#BUILD_STEP is bundle or container. bundle for pushing to s3, container for docker image.
ARG BUILD_STEP
ENV BUILD_STEP=$BUILD_STEP
RUN if [ "$BUILD_STEP" = "bundle" ]; then \
echo "BUNDLE version $PUBLIC_BUILD_VERSION"; \
pnpm install && \
pnpm build; \
elif [ "$BUILD_STEP" = "container" ]; then \
echo "CONTAINER version $PUBLIC_BUILD_VERSION"; \
pnpm install --production && \
pnpm prune && \
pnpm store prune; \
fi;
EXPOSE 4225
CMD ["pnpm", "start-server"]