From b11c23c3462f4f3e9a92e2a99ae07628873c1ed2 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Sat, 8 Mar 2025 12:32:03 +0000 Subject: [PATCH] chore: update build --- .github/workflows/build.yml | 47 ------------------------------------- build/ci.Dockerfile | 33 -------------------------- build/server.Dockerfile | 8 +++---- 3 files changed, 4 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 build/ci.Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index f0b544e6..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: build - -on: [ workflow_dispatch ] - -jobs: - everything: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-updatetar - restore-keys: | - ${{ runner.os }}-buildx-updatetar - - - name: Build Docker image - uses: docker/build-push-action@v5 - with: - context: . - file: build/ci.Dockerfile - load: true - tags: ci_image:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new - - - name: Extract artifact from Docker image - run: | - docker create --name extract_artifact ci_image:latest - docker cp extract_artifact:/lamassu-server.tar.gz ./lamassu-server.tar.gz - docker rm extract_artifact - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: lamassu-server.tar.gz - path: lamassu-server.tar.gz - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/build/ci.Dockerfile b/build/ci.Dockerfile deleted file mode 100644 index 8eeaf0a6..00000000 --- a/build/ci.Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM ubuntu:20.04 as base - -ARG VERSION -ARG DEBIAN_FRONTEND=noninteractive -ENV TZ=Europe/Lisbon - -RUN apt-get update - -RUN apt-get install -y -q curl \ - sudo \ - git \ - python2-minimal \ - build-essential \ - libpq-dev \ - net-tools \ - tar - -RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - -RUN apt-get install nodejs -y -q - -WORKDIR lamassu-server - -COPY ["package.json", "package-lock.json", "./"] -RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0 -RUN npm install --production - -COPY . ./ - -RUN cd new-lamassu-admin && npm install && npm run build -RUN mv new-lamassu-admin/build public/ -RUN rm -rf new-lamassu-admin/node_modules - -RUN cd .. && tar -zcvf lamassu-server.tar.gz ./lamassu-server diff --git a/build/server.Dockerfile b/build/server.Dockerfile index ec436e90..a46967db 100644 --- a/build/server.Dockerfile +++ b/build/server.Dockerfile @@ -1,5 +1,5 @@ -FROM alpine:3.14 AS build -RUN apk add --no-cache nodejs npm git curl build-base net-tools python3 postgresql-dev +FROM node:22-alpine AS build +RUN apk add --no-cache npm git curl build-base net-tools python3 postgresql-dev WORKDIR lamassu-server @@ -10,8 +10,8 @@ RUN npm install --production COPY . ./ -FROM alpine:3.14 AS l-s-base -RUN apk add --no-cache nodejs npm git curl bash libpq openssl ca-certificates +FROM node:22-alpine AS l-s-base +RUN apk add --no-cache npm git curl bash libpq openssl ca-certificates COPY --from=build /lamassu-server /lamassu-server