Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Build

on:
pull_request: {}
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Docker image
run: |
docker build -t xcontest-api .

- name: Save Docker image as artifact
run: |
docker save xcontest-api | gzip > docker-image.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: docker-image
path: docker-image.tar.gz
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM node:22.16.0-alpine3.22 AS base

# Install pnpm
RUN corepack enable && corepack prepare pnpm@10.30.1 --activate
# Install pnpm and husky
RUN corepack enable && corepack prepare pnpm@10.30.1 --activate && npm install -g husky
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use pnpm?

Suggested change
RUN corepack enable && corepack prepare pnpm@10.30.1 --activate && npm install -g husky
RUN corepack enable && corepack prepare pnpm@10.30.1 --activate && pnpm install -g husky



# Install development and build dependencies
FROM base AS deps
WORKDIR /app
ADD package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
RUN pnpm install --frozen-lockfile && npx husky install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Suggested change
RUN pnpm install --frozen-lockfile && npx husky install
RUN pnpm install --frozen-lockfile && pnpx husky install


# Install only production dependencies
FROM base AS production-deps
Expand Down