diff --git a/.dockerignore b/.dockerignore index c627bb6c..5c8d6f5b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,4 +14,6 @@ helm-charts .idea coverage* uploads -logs \ No newline at end of file +logs +dist +pages/dist \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index fc8026cc..21377659 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -71,7 +71,7 @@ jobs: # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push - uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + uses: docker/build-push-action@v5.1.0 with: context: . push: ${{ github.event_name != 'pull_request' }} diff --git a/Dockerfile b/Dockerfile index ada6e762..f4b9dc3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,23 +12,25 @@ COPY --from=node:18-alpine /usr/local/bin/node /usr/local/bin/node FROM base AS install # install with --production (exclude devDependencies) -RUN mkdir -p /temp/prod -COPY . /temp/prod/ -RUN cd /temp/prod && bun install --frozen-lockfile --production. +RUN mkdir -p /temp +COPY . /temp +WORKDIR /temp +RUN bun install --frozen-lockfile --production. # Build Vite in pages -RUN cd /temp/prod && bunx --bun vite build pages +RUN bunx --bun vite build pages # Build the project -RUN cd /temp/prod && bun run build.ts +RUN bun run build.ts +WORKDIR /temp/dist # copy production dependencies and source code into final image FROM base AS release # Create app directory RUN mkdir -p /app -COPY --from=install /temp/prod/dist /app/dist -COPY --from=install /temp/prod/pages /app/pages +COPY --from=install /temp/dist /app/dist +COPY --from=install /temp/pages /app/pages COPY entrypoint.sh /app