add build script

This commit is contained in:
Avraham Sakal
2024-11-19 21:19:31 -05:00
parent b46f213b2d
commit 490ae1898e
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ COPY . /app
RUN pnpm run build RUN pnpm run build
FROM base FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=prod /app/node_modules /app/node_modules COPY --from=prod /app/node_modules /app/node_modules
COPY --from=prod /app/dist /app COPY --from=prod /app/dist /app
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
REGISTRY=registry.sakal.us
IMAGE_NAME=blog-astro
# get version from package.json and remove quotes:
VERSION=$(pnpm pkg get version | xargs)
docker build -t "${REGISTRY}/${IMAGE_NAME}:v${VERSION}" --target final .
docker push "${REGISTRY}/${IMAGE_NAME}:v${VERSION}"