Compare commits
10 Commits
v5.0.12
...
feature/mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04f97c34c8 | ||
|
|
03569bcc72 | ||
|
|
408c36a221 | ||
|
|
1315026fb4 | ||
|
|
f2cdcb69d3 | ||
|
|
1cadb680b9 | ||
|
|
9ff79941ba | ||
|
|
9a04fe8697 | ||
|
|
facc5178ce | ||
|
|
0bbe3ed1a1 |
123
.github/workflows/docker-build-push-dockerhub-arm.yml
vendored
Normal file
123
.github/workflows/docker-build-push-dockerhub-arm.yml
vendored
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
|
name: Build and push ARM image to DockerHub
|
||||||
|
|
||||||
|
# Controls when the workflow will run
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
# update on run of Update Calendso nightly submodule update
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Update Calendso"]
|
||||||
|
branches: [main]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
# Allow running workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# Leaving in example for releases. Initially we simply push to 'latest'
|
||||||
|
# on:
|
||||||
|
# release:
|
||||||
|
# types: [ created ]
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
# This workflow contains a single job called "build"
|
||||||
|
build:
|
||||||
|
# The type of runner that the job will run on
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
steps:
|
||||||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Git submodule update
|
||||||
|
run: |
|
||||||
|
git submodule update --init
|
||||||
|
|
||||||
|
- name: Log in to the Docker Hub registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
# Username used to log against the Docker registry
|
||||||
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
# Password or personal access token used to log against the Docker registry
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
# Log out from the Docker registry at the end of a job
|
||||||
|
logout: true # optional, default is true
|
||||||
|
|
||||||
|
- name: Log in to the Github Container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
flavor: |
|
||||||
|
suffix=-arm
|
||||||
|
images: |
|
||||||
|
docker.io/calendso/calendso
|
||||||
|
docker.io/calcom/cal.com
|
||||||
|
ghcr.io/calcom/cal.com
|
||||||
|
|
||||||
|
- name: Copy env
|
||||||
|
run: |
|
||||||
|
grep -o '^[^#]*' .env.example > .env
|
||||||
|
cat .env >> $GITHUB_ENV
|
||||||
|
echo "DATABASE_HOST=localhost:5432" >> $GITHUB_ENV
|
||||||
|
eval $(sed -e '/^#/d' -e 's/^/export /' -e 's/$/;/' .env) ;
|
||||||
|
|
||||||
|
# Temporarily disable ARM build due to runner performance issues
|
||||||
|
# - name: Set up QEMU
|
||||||
|
# uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Start database
|
||||||
|
run: |
|
||||||
|
docker compose up -d database
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
driver-opts: |
|
||||||
|
network=container:database
|
||||||
|
buildkitd-flags: |
|
||||||
|
--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
||||||
|
# config-inline: |
|
||||||
|
# [worker.oci]
|
||||||
|
# max-parallelism = 1
|
||||||
|
|
||||||
|
- name: Build and push image
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: ./
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }}
|
||||||
|
NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }}
|
||||||
|
NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }}
|
||||||
|
DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }}
|
||||||
|
|
||||||
|
# - name: Build with docker compose
|
||||||
|
# run: |
|
||||||
|
# DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
run: |
|
||||||
|
docker compose down
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
@@ -61,6 +61,8 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
|
flavor: |
|
||||||
|
suffix=-arm
|
||||||
images: |
|
images: |
|
||||||
docker.io/calendso/calendso
|
docker.io/calendso/calendso
|
||||||
docker.io/calcom/cal.com
|
docker.io/calcom/cal.com
|
||||||
@@ -74,8 +76,8 @@ jobs:
|
|||||||
eval $(sed -e '/^#/d' -e 's/^/export /' -e 's/$/;/' .env) ;
|
eval $(sed -e '/^#/d' -e 's/^/export /' -e 's/$/;/' .env) ;
|
||||||
|
|
||||||
# Temporarily disable ARM build due to runner performance issues
|
# Temporarily disable ARM build due to runner performance issues
|
||||||
# - name: Set up QEMU
|
- name: Set up QEMU
|
||||||
# uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Start database
|
- name: Start database
|
||||||
run: |
|
run: |
|
||||||
@@ -84,6 +86,7 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
network=container:database
|
network=container:database
|
||||||
buildkitd-flags: |
|
buildkitd-flags: |
|
||||||
@@ -108,10 +111,6 @@ jobs:
|
|||||||
NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }}
|
NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }}
|
||||||
DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }}
|
DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }}
|
||||||
|
|
||||||
# - name: Build with docker compose
|
|
||||||
# run: |
|
|
||||||
# DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom
|
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: |
|
run: |
|
||||||
docker compose down
|
docker compose down
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM node:18 as builder
|
FROM --platform=$BUILDPLATFORM node:18 as builder
|
||||||
|
|
||||||
WORKDIR /calcom
|
WORKDIR /calcom
|
||||||
|
|
||||||
@@ -28,13 +28,14 @@ RUN yarn config set httpTimeout 1200000 && \
|
|||||||
yarn db-deploy && \
|
yarn db-deploy && \
|
||||||
yarn --cwd packages/prisma seed-app-store
|
yarn --cwd packages/prisma seed-app-store
|
||||||
|
|
||||||
RUN yarn turbo run build --filter=@calcom/web
|
RUN --mount=type=tmpfs,destination=/tmp \
|
||||||
|
yarn turbo run build --filter=@calcom/web
|
||||||
|
|
||||||
# RUN yarn plugin import workspace-tools && \
|
# RUN yarn plugin import workspace-tools && \
|
||||||
# yarn workspaces focus --all --production
|
# yarn workspaces focus --all --production
|
||||||
RUN rm -rf node_modules/.cache .yarn/cache apps/web/.next/cache
|
RUN rm -rf node_modules/.cache .yarn/cache apps/web/.next/cache
|
||||||
|
|
||||||
FROM node:18 as builder-two
|
FROM --platform=$BUILDPLATFORM node:18 as builder-two
|
||||||
|
|
||||||
WORKDIR /calcom
|
WORKDIR /calcom
|
||||||
ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||||
@@ -55,10 +56,10 @@ ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
|
|||||||
BUILT_NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL
|
BUILT_NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL
|
||||||
|
|
||||||
RUN scripts/replace-placeholder.sh http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER ${NEXT_PUBLIC_WEBAPP_URL}
|
RUN scripts/replace-placeholder.sh http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER ${NEXT_PUBLIC_WEBAPP_URL}
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
ARG TARGETARCH
|
||||||
FROM node:18 as runner
|
FROM node:18 as runner
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /calcom
|
WORKDIR /calcom
|
||||||
COPY --from=builder-two /calcom ./
|
COPY --from=builder-two /calcom ./
|
||||||
ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||||
|
|||||||
Reference in New Issue
Block a user