Skip to content

Commit

Permalink
Dockerfile: pnpm -> bun and update docker actions version
Browse files Browse the repository at this point in the history
  • Loading branch information
fizfakovets committed Mar 5, 2024
1 parent 8d9eda9 commit 49ca740
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6,473 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=test,enable=true
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
file: ./deployment/Dockerfile
context: .
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Define preprod metadata
id: meta-preprod
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=preprod,enable=true
- name: Build and push preprod Docker
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
file: ./deployment/Dockerfile
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Expand Down
13 changes: 6 additions & 7 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 as base
COPY . /app
WORKDIR /app

Expand All @@ -13,11 +12,11 @@ ENV MODE=${LAUNCH_MODE}
ENV VITE_APP_VERSION=${APP_VERSION}

FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
RUN --mount=type=cache,id=bun,target=/bun/store bun install --frozen-lockfile --production

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build --mode ${BUILD_MODE}
RUN --mount=type=cache,id=bun,target=/bun/store bun install --frozen-lockfile
RUN bun run build --mode ${BUILD_MODE}


FROM nginx:1.21
Expand Down
Loading

0 comments on commit 49ca740

Please sign in to comment.