Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workarounds for Node Build Issues #29

Merged
merged 2 commits into from
Jul 19, 2024
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
11 changes: 8 additions & 3 deletions .github/workflows/pr-test-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: PR Test Build

on:
pull_request:
Expand All @@ -9,5 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag stefpletinck/betty:$(git rev-parse HEAD)
- uses: actions/setup-node@v4
with:
node-version: 22.4.x
- name: Install dependencies
run: npm ci --include dev
- name: Build
run: npx tsup src/server.ts src/deploy-commands.ts --minify
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM node:22-alpine as compile
FROM node:22.4-alpine as compile
RUN apk --no-cache add curl python3 build-base
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --include dev
COPY . .
RUN ["npx", "tsup", "src/server.ts", "src/deploy-commands.ts", "--minify"]

FROM node:22-alpine as modules
FROM node:22.4-alpine as modules
RUN apk --no-cache add curl python3 build-base
WORKDIR /usr/src/app
COPY --from=compile /usr/src/app/package*.json ./
RUN npm ci --omit dev

FROM node:22-alpine
FROM node:22.4-alpine
RUN apk --no-cache add curl
WORKDIR /usr/src/app
COPY --from=modules /usr/src/app/node_modules ./node_modules
Expand Down