Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
646dfd0e8f |
@@ -13,7 +13,6 @@ LICENSE=
|
||||
# NEXT_PUBLIC_APP_URL=http://localhost:3000
|
||||
|
||||
NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||
NEXT_PUBLIC_API_V2_URL=http://localhost:5555/api/v2
|
||||
|
||||
# Configure NEXTAUTH_URL manually if needed, otherwise it will resolve to {NEXT_PUBLIC_WEBAPP_URL}/api/auth
|
||||
# NEXTAUTH_URL=http://localhost:3000/api/auth
|
||||
@@ -51,7 +50,6 @@ ZOOM_CLIENT_SECRET=
|
||||
|
||||
# E-mail settings
|
||||
# Configures the global From: header whilst sending emails.
|
||||
EMAIL_FROM_NAME=YourOrganizationName
|
||||
EMAIL_FROM=notifications@example.com
|
||||
|
||||
# Configure SMTP settings (@see https://nodemailer.com/smtp/).
|
||||
|
||||
@@ -20,7 +20,7 @@ on:
|
||||
# Uncomment below to allow specific version workflow run
|
||||
# inputs:
|
||||
# version:
|
||||
# description: 'Version to build'
|
||||
# description: 'Version to build'
|
||||
# required: true
|
||||
|
||||
# Leaving in example for releases. Initially we simply push to 'latest'
|
||||
@@ -37,12 +37,6 @@ jobs:
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
# Free about 4.5 GB, elminating our disk space issues
|
||||
tool-cache: true
|
||||
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it, uncomment below
|
||||
# - name: Checkout code at specified version
|
||||
# uses: actions/checkout@v2
|
||||
@@ -72,7 +66,7 @@ jobs:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
@@ -99,7 +93,7 @@ jobs:
|
||||
- name: Start database
|
||||
run: |
|
||||
docker compose up -d database
|
||||
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
@@ -124,7 +118,6 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }}
|
||||
NEXT_PUBLIC_API_V2_URL=${{ env.NEXT_PUBLIC_API_V2_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 }}
|
||||
@@ -135,7 +128,7 @@ jobs:
|
||||
tags="${{ steps.meta.outputs.tags }}"
|
||||
IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter
|
||||
tag=${ADDR[0]} # Get the first tag
|
||||
|
||||
|
||||
docker run --rm --network stack \
|
||||
-p 3000:3000 \
|
||||
-e DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@database/${{ env.POSTGRES_DB }} \
|
||||
@@ -143,7 +136,7 @@ jobs:
|
||||
-e NEXTAUTH_SECRET=${{ env.NEXTAUTH_SECRET }} \
|
||||
-e CALENDSO_ENCRYPTION_KEY=${{ env.CALENDSO_ENCRYPTION_KEY }} \
|
||||
$tag &
|
||||
|
||||
|
||||
server_pid=$!
|
||||
|
||||
|
||||
@@ -151,7 +144,7 @@ jobs:
|
||||
sleep 120
|
||||
|
||||
echo ${{ env.NEXT_PUBLIC_WEBAPP_URL }}/auth/login
|
||||
|
||||
|
||||
for i in {1..60}; do
|
||||
echo "Checking server health ($i/60)..."
|
||||
response=$(curl -o /dev/null -s -w "%{http_code}" ${{ env.NEXT_PUBLIC_WEBAPP_URL }}/auth/login)
|
||||
@@ -164,13 +157,22 @@ jobs:
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
||||
echo "Server health check failed"
|
||||
kill $server_pid
|
||||
exit 1
|
||||
env:
|
||||
NEXTAUTH_SECRET: 'EI4qqDpcfdvf4A+0aQEEx8JjHxHSy4uWiZw/F32K+pA='
|
||||
CALENDSO_ENCRYPTION_KEY: '0zfLtY99wjeLnsM7qsa8xsT+Q0oSgnOL'
|
||||
|
||||
|
||||
# - name: Push image
|
||||
# run: |
|
||||
# tags="${{ steps.meta.outputs.tags }}"
|
||||
# IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter
|
||||
# for tag in "${ADDR[@]}"; do
|
||||
# docker push $tag
|
||||
# done
|
||||
|
||||
- name: Push image
|
||||
id: docker_push
|
||||
@@ -178,22 +180,21 @@ jobs:
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }}
|
||||
NEXT_PUBLIC_API_V2_URL=${{ env.NEXT_PUBLIC_API_V2_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 }}
|
||||
DATABASE_DIRECT_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }}
|
||||
if: ${{ !github.event.release.prerelease }}
|
||||
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
|
||||
- name: Cleanup
|
||||
run: |
|
||||
docker compose down
|
||||
|
||||
37
Dockerfile
37
Dockerfile
@@ -1,4 +1,4 @@
|
||||
FROM node:18 AS builder
|
||||
FROM node:18 as builder
|
||||
|
||||
WORKDIR /calcom
|
||||
|
||||
@@ -8,50 +8,43 @@ ARG DATABASE_URL
|
||||
ARG NEXTAUTH_SECRET=secret
|
||||
ARG CALENDSO_ENCRYPTION_KEY=secret
|
||||
ARG MAX_OLD_SPACE_SIZE=4096
|
||||
ARG NEXT_PUBLIC_API_V2_URL
|
||||
|
||||
ENV NEXT_PUBLIC_WEBAPP_URL=http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER \
|
||||
NEXT_PUBLIC_API_V2_URL=$NEXT_PUBLIC_API_V2_URL \
|
||||
NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \
|
||||
CALCOM_TELEMETRY_DISABLED=$CALCOM_TELEMETRY_DISABLED \
|
||||
DATABASE_URL=$DATABASE_URL \
|
||||
DATABASE_DIRECT_URL=$DATABASE_URL \
|
||||
NEXTAUTH_SECRET=${NEXTAUTH_SECRET} \
|
||||
CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY} \
|
||||
NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE} \
|
||||
BUILD_STANDALONE=true
|
||||
NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE}
|
||||
|
||||
COPY calcom/package.json calcom/yarn.lock calcom/.yarnrc.yml calcom/playwright.config.ts calcom/turbo.json calcom/git-init.sh calcom/git-setup.sh calcom/i18n.json ./
|
||||
COPY calcom/package.json calcom/yarn.lock calcom/.yarnrc.yml calcom/playwright.config.ts calcom/turbo.json calcom/git-init.sh calcom/git-setup.sh ./
|
||||
COPY calcom/.yarn ./.yarn
|
||||
COPY calcom/apps/web ./apps/web
|
||||
COPY calcom/apps/api/v2 ./apps/api/v2
|
||||
COPY calcom/packages ./packages
|
||||
COPY calcom/tests ./tests
|
||||
|
||||
RUN yarn config set httpTimeout 1200000
|
||||
RUN npx turbo prune --scope=@calcom/web --scope=@calcom/trpc --docker
|
||||
RUN yarn install
|
||||
RUN yarn db-deploy
|
||||
RUN yarn --cwd packages/prisma seed-app-store
|
||||
# Build and make embed servable from web/public/embed folder
|
||||
RUN yarn workspace @calcom/trpc run build
|
||||
RUN yarn --cwd packages/embeds/embed-core workspace @calcom/embed-core run build
|
||||
RUN yarn --cwd apps/web workspace @calcom/web run build
|
||||
RUN yarn config set httpTimeout 1200000 && \
|
||||
npx turbo prune --scope=@calcom/web --docker && \
|
||||
yarn install && \
|
||||
yarn db-deploy && \
|
||||
yarn --cwd packages/prisma seed-app-store
|
||||
|
||||
RUN yarn turbo run build --filter=@calcom/web
|
||||
|
||||
# RUN yarn plugin import workspace-tools && \
|
||||
# yarn workspaces focus --all --production
|
||||
RUN rm -rf node_modules/.cache .yarn/cache apps/web/.next/cache
|
||||
|
||||
FROM node:18 AS builder-two
|
||||
FROM node:18 as builder-two
|
||||
|
||||
WORKDIR /calcom
|
||||
ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_ENV production
|
||||
|
||||
COPY calcom/package.json calcom/.yarnrc.yml calcom/turbo.json calcom/i18n.json ./
|
||||
COPY calcom/package.json calcom/.yarnrc.yml calcom/yarn.lock calcom/turbo.json ./
|
||||
COPY calcom/.yarn ./.yarn
|
||||
COPY --from=builder /calcom/yarn.lock ./yarn.lock
|
||||
COPY --from=builder /calcom/node_modules ./node_modules
|
||||
COPY --from=builder /calcom/packages ./packages
|
||||
COPY --from=builder /calcom/apps/web ./apps/web
|
||||
@@ -65,7 +58,7 @@ ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
|
||||
|
||||
RUN scripts/replace-placeholder.sh http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER ${NEXT_PUBLIC_WEBAPP_URL}
|
||||
|
||||
FROM node:18 AS runner
|
||||
FROM node:18 as runner
|
||||
|
||||
|
||||
WORKDIR /calcom
|
||||
@@ -74,7 +67,7 @@ ARG NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||
ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
|
||||
BUILT_NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_ENV production
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=30s --retries=5 \
|
||||
|
||||
@@ -52,7 +52,7 @@ If you are evaluating Cal.com or running with minimal to no modifications, this
|
||||
1. Clone calcom/docker
|
||||
|
||||
```bash
|
||||
git clone --recursive https://github.com/calcom/docker.git
|
||||
git clone https://github.com/calcom/docker.git
|
||||
```
|
||||
|
||||
2. Change into the directory
|
||||
|
||||
2
calcom
2
calcom
Submodule calcom updated: 4e02fe4251...60ae817f30
@@ -1,4 +1,5 @@
|
||||
# Use postgres/example user/password credentials
|
||||
version: '3.8'
|
||||
|
||||
volumes:
|
||||
database-data:
|
||||
@@ -26,7 +27,6 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL}
|
||||
NEXT_PUBLIC_API_V2_URL: ${NEXT_PUBLIC_API_V2_URL}
|
||||
NEXT_PUBLIC_LICENSE_CONSENT: ${NEXT_PUBLIC_LICENSE_CONSENT}
|
||||
CALCOM_TELEMETRY_DISABLED: ${CALCOM_TELEMETRY_DISABLED}
|
||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
|
||||
|
||||
@@ -23,4 +23,4 @@ services:
|
||||
|
||||
databases:
|
||||
- name: cal-postgres
|
||||
plan: basic-1gb
|
||||
plan: starter
|
||||
|
||||
@@ -10,6 +10,7 @@ fi
|
||||
# Only peform action if $FROM and $TO are different.
|
||||
echo "Replacing all statically built instances of $FROM with $TO."
|
||||
|
||||
for file in $(egrep -r -l "${FROM}" apps/web/.next/ apps/web/public/); do
|
||||
sed -i -e "s|$FROM|$TO|g" "$file"
|
||||
find apps/web/.next/ apps/web/public -type f |
|
||||
while read file; do
|
||||
sed -i "s|$FROM|$TO|g" "$file"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user