add arm support

pull/1674/head
Iván Salazar 2022-11-23 16:37:25 -06:00
parent 9ee6fb994c
commit d916ebef5c
6 changed files with 8321 additions and 33 deletions

View File

@ -18,14 +18,29 @@ jobs:
db-type: [postgresql, mysql]
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image for ${{ matrix.db-type }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
image: umami
tags: ${{ matrix.db-type }}-${{ inputs.version }}, ${{ matrix.db-type }}-latest
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish for ${{ matrix.db-type }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ github.repository }}:${{ matrix.db-type }}-${{ inputs.version }}, ghcr.io/${{ github.repository }}:${{ matrix.db-type }}-latest
build-args: DATABASE_TYPE=${{ matrix.db-type }}

View File

@ -14,17 +14,29 @@ jobs:
db-type: [postgresql, mysql]
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image for ${{ matrix.db-type }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
image: umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish for ${{ matrix.db-type }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ github.repository }}:${{ matrix.db-type }}-${{ inputs.version }}, ghcr.io/${{ github.repository }}:${{ matrix.db-type }}-latest
build-args: DATABASE_TYPE=${{ matrix.db-type }}

View File

@ -16,9 +16,9 @@ jobs:
strategy:
matrix:
include:
- node-version: 14.x
- node-version: 18.x
db-type: postgresql
- node-version: 14.x
- node-version: 18.x
db-type: mysql
- node-version: 16.x
db-type: postgresql
@ -34,6 +34,6 @@ jobs:
cache: 'npm'
env:
DATABASE_TYPE: ${{ matrix.db-type }}
- run: npm install --global yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npm i -g pnpm
- run: pnpm install
- run: pnpm build

View File

@ -1,16 +1,20 @@
FROM node:18-slim as base
RUN npm i -g pnpm
RUN apt-get update && apt-get install -y openssl libssl-dev
# RUN apk add --no-cache openssl libc6-compat openssl1.1-compat-dev
# Install dependencies only when needed
FROM node:16-alpine AS deps
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:16-alpine AS builder
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
COPY --from=deps /app/node_modules ./node_modules
ARG DATABASE_TYPE
ARG BASE_PATH
@ -20,10 +24,10 @@ ENV BASE_PATH $BASE_PATH
ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build-docker
RUN pnpm build-docker
# Production image, copy all the files and run next
FROM node:16-alpine AS runner
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
@ -32,7 +36,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN yarn add npm-run-all dotenv prisma
RUN pnpm i npm-run-all dotenv prisma
# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js .
@ -52,4 +56,4 @@ EXPOSE 3000
ENV PORT 3000
CMD ["yarn", "start-docker"]
CMD ["pnpm", "start-docker"]

View File

@ -13,7 +13,7 @@ services:
- db
restart: always
db:
image: postgres:12-alpine
image: postgres:14-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami

8257
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff