add arm support
parent
9ee6fb994c
commit
d916ebef5c
|
@ -18,14 +18,29 @@ jobs:
|
||||||
db-type: [postgresql, mysql]
|
db-type: [postgresql, mysql]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: mr-smithers-excellent/docker-build-push@v5
|
- name: Set up QEMU
|
||||||
name: Build & push Docker image for ${{ matrix.db-type }}
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
image: umami
|
|
||||||
tags: ${{ matrix.db-type }}-${{ inputs.version }}, ${{ matrix.db-type }}-latest
|
|
||||||
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
|
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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 }}
|
||||||
|
|
|
@ -14,17 +14,29 @@ jobs:
|
||||||
db-type: [postgresql, mysql]
|
db-type: [postgresql, mysql]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set env
|
- name: Set up QEMU
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- uses: mr-smithers-excellent/docker-build-push@v5
|
- name: Set up Docker Buildx
|
||||||
name: Build & push Docker image for ${{ matrix.db-type }}
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
image: umami
|
|
||||||
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
|
|
||||||
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
|
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
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 }}
|
||||||
|
|
|
@ -16,9 +16,9 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- node-version: 14.x
|
- node-version: 18.x
|
||||||
db-type: postgresql
|
db-type: postgresql
|
||||||
- node-version: 14.x
|
- node-version: 18.x
|
||||||
db-type: mysql
|
db-type: mysql
|
||||||
- node-version: 16.x
|
- node-version: 16.x
|
||||||
db-type: postgresql
|
db-type: postgresql
|
||||||
|
@ -34,6 +34,6 @@ jobs:
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
env:
|
env:
|
||||||
DATABASE_TYPE: ${{ matrix.db-type }}
|
DATABASE_TYPE: ${{ matrix.db-type }}
|
||||||
- run: npm install --global yarn
|
- run: npm i -g pnpm
|
||||||
- run: yarn install --frozen-lockfile
|
- run: pnpm install
|
||||||
- run: yarn build
|
- run: pnpm build
|
||||||
|
|
24
Dockerfile
24
Dockerfile
|
@ -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
|
# 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.
|
# 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
|
WORKDIR /app
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN yarn install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
# Rebuild the source code only when needed
|
||||||
FROM node:16-alpine AS builder
|
FROM base AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
|
||||||
ARG DATABASE_TYPE
|
ARG DATABASE_TYPE
|
||||||
ARG BASE_PATH
|
ARG BASE_PATH
|
||||||
|
@ -20,10 +24,10 @@ ENV BASE_PATH $BASE_PATH
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
RUN yarn build-docker
|
RUN pnpm build-docker
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM node:16-alpine AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
|
@ -32,7 +36,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
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
|
# You only need to copy next.config.js if you are NOT using the default configuration
|
||||||
COPY --from=builder /app/next.config.js .
|
COPY --from=builder /app/next.config.js .
|
||||||
|
@ -52,4 +56,4 @@ EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
|
|
||||||
CMD ["yarn", "start-docker"]
|
CMD ["pnpm", "start-docker"]
|
||||||
|
|
|
@ -13,7 +13,7 @@ services:
|
||||||
- db
|
- db
|
||||||
restart: always
|
restart: always
|
||||||
db:
|
db:
|
||||||
image: postgres:12-alpine
|
image: postgres:14-alpine
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: umami
|
POSTGRES_DB: umami
|
||||||
POSTGRES_USER: umami
|
POSTGRES_USER: umami
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue