Adding template for docker
This commit is contained in:
parent
1fbd64e412
commit
bfe846c9b2
29
.github/repo-templates/d/actions-build.Dockerfile
vendored
Normal file
29
.github/repo-templates/d/actions-build.Dockerfile
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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"]
|
||||||
Loading…
x
Reference in New Issue
Block a user