Skip to content

Commit

Permalink
🏗️ Add compatibility with different prisma clients
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 9, 2023
1 parent c879c6f commit caf5432
Show file tree
Hide file tree
Showing 65 changed files with 942 additions and 211 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Dockerfile
.dockerignore
node_modules
**/node_modules
npm-debug.log
README.md
.next
Expand All @@ -10,5 +10,5 @@ README.md

landing-page
docs
scripts
packages/scripts
wordpress
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ ARG SCOPE
ENV SCOPE=${SCOPE}
RUN npm --global install pnpm

FROM base AS pruner
RUN npm --global install turbo
WORKDIR /app
COPY . .
RUN turbo prune --scope=${SCOPE} --docker

FROM base AS builder
RUN apt-get -qy update && apt-get -qy --no-install-recommends install openssl git
COPY pnpm-lock.yaml .npmrc pnpm-workspace.yaml ./
RUN pnpm fetch
ADD . ./
RUN pnpm install -r --offline
WORKDIR /app
COPY .gitignore .gitignore
COPY .npmrc .pnpmfile.cjs ./
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json

RUN pnpm turbo run build:docker --filter=${SCOPE}...

FROM base AS runner
Expand All @@ -21,7 +32,7 @@ RUN apt-get -qy update \
&& apt-get autoremove -yq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY ./packages/db/prisma ./prisma
COPY ./packages/db ./packages/db
COPY ./apps/${SCOPE}/.env.docker ./apps/${SCOPE}/.env.production
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/${SCOPE}/public ./apps/${SCOPE}/public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { importTypebotInDatabase } from 'utils/playwright/databaseActions'
import { typebotViewer } from 'utils/playwright/testHelpers'
import { getTestAsset } from '@/test/utils/playwright'

const mockSmtpCredentials: SmtpCredentialsData = {
export const mockSmtpCredentials: SmtpCredentialsData = {
from: {
email: 'ted.kreiger@ethereal.email',
name: 'Ted Kreiger',
email: 'sunny.cremin66@ethereal.email',
name: 'Sunny Cremin',
},
host: 'smtp.ethereal.email',
port: 587,
username: 'ted.kreiger@ethereal.email',
password: 'bFYFHfWjFxB9MK28zS',
username: 'sunny.cremin66@ethereal.email',
password: 'yJDHkf2bYbNydaRvTq',
}

test.beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { getTestAsset } from '@/test/utils/playwright'

const mockSmtpCredentials: SmtpCredentialsData = {
from: {
email: 'ted.kreiger@ethereal.email',
name: 'Ted Kreiger',
email: 'sunny.cremin66@ethereal.email',
name: 'Sunny Cremin',
},
host: 'smtp.ethereal.email',
port: 587,
username: 'ted.kreiger@ethereal.email',
password: 'bFYFHfWjFxB9MK28zS',
username: 'sunny.cremin66@ethereal.email',
password: 'yJDHkf2bYbNydaRvTq',
}

test.beforeAll(async () => {
Expand Down
11 changes: 9 additions & 2 deletions builder-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

ENVSH_ENV=./apps/builder/.env.production ENVSH_OUTPUT=./apps/builder/public/__env.js bash env.sh

./node_modules/.bin/prisma generate;
if [[ $DATABASE_URL == postgresql://* ]]; then
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
else
./node_modules/.bin/prisma generate --schema=packages/db/mysql/schema.prisma;
fi

echo 'Waiting 5s for db to be ready...';
sleep 5;

./node_modules/.bin/prisma migrate deploy;
if [[ $DATABASE_URL == postgresql://* ]]; then
./node_modules/.bin/prisma migrate deploy --schema=packages/db/postgresql/schema.prisma;
fi


node apps/builder/server.js;
8 changes: 0 additions & 8 deletions packages/db/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
export * from '@prisma/client'

// Named export for enums to avoid vite barrel export bug (https://github.com/nrwl/nx/issues/13704)
export {
Plan,
WorkspaceRole,
GraphNavigation,
CollaborationType,
} from '@prisma/client'
Loading

4 comments on commit caf5432

@vercel
Copy link

@vercel vercel bot commented on caf5432 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

an.nigerias.io
app.yvon.earth
ar.nigerias.io
bot.enreso.org
bot.rslabs.pro
bots.bridge.ai
chat.hayuri.id
chicken.cr8.ai
gollum.riku.ai
gsbulletin.com
panther.cr7.ai
bbutton.wpwakanda.com
bot.coachayongzul.com
bot.digitalpointer.id
bot.eikju.photography
bot.incusservices.com
bot.meuesocial.com.br
bot.mycompany.reviews
bot.outstandbrand.com
bot.ramonmatos.com.br
bot.robertohairlab.it
bot.sharemyreview.net
bot.truongnguyen.live
botz.cloudsiteapp.com
cdd.searchcube.com.sg
chat.missarkansas.org
chatbot.ownacademy.co
criar.somaperuzzo.com
sbutton.wpwakanda.com
815639944.21000000.one
aplicacao.bmind.com.br
apply.ansuraniphone.my
bbutton.wpwwakanda.com
bot.ilmuseoaiborghi.it
bot.louismarcondes.com
bot.pratikmandalia.com
bot.t20worldcup.com.au
c23111azqw.nigerias.io
dieta.barrettamario.it
felipewelington.com.br
form.bridesquadapp.com
form.searchcube.com.sg
gcase.barrettamario.it
help.giversforgood.com
info.clickasuransi.com
kodawariab736.skeep.it
michaeljackson.riku.ai
premium.kandabrand.com
report.gratirabbit.com
resume.gratirabbit.com
83242573.actualizar.xyz
87656003.actualizar.xyz
88152257.actualizar.xyz
91375310.actualizar.xyz
arrivalx2.wpwakanda.com
bot.blackboxtips.com.br
herbalife.barrettamario.it
homepageonly.wpwakanda.com
liveconvert.kandalearn.com
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
ted.meujalecobrasil.com.br
type.dericsoncalari.com.br
bot.pinpointinteractive.com
bot.polychromes-project.com
bot.seidinembroseanchetu.it
chatbot.berbelanjabiz.trade
designguide.techyscouts.com
liveconvert2.kandalearn.com
presente.empresarias.com.mx
sell.sellthemotorhome.co.uk
anamnese.odontopavani.com.br
austin.channelautomation.com
bot.marketingplusmindset.com
bot.seidibergamoseanchetu.it
desabafe.sergiolimajr.com.br
download.venturemarketing.in
piazzatorre.barrettamario.it
type.cookieacademyonline.com
bot.brigadeirosemdrama.com.br
forms.escoladeautomacao.com.br
onboarding.libertydreamcare.ie
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
anamnese.clinicamegasjdr.com.br
bookings.littlepartymonkeys.com
bot.comercializadoraomicron.com
elevateyourmind.groovepages.com
viewer-v2-typebot-io.vercel.app
yourfeedback.comebackreward.com
gerador.verificadordehospedes.com
personal-trainer.barrettamario.it
preagendamento.sergiolimajr.com.br
studiotecnicoimmobiliaremerelli.it
download.thailandmicespecialist.com
register.thailandmicespecialist.com
bot.studiotecnicoimmobiliaremerelli.it
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
viewer-v2-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on caf5432 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on caf5432 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

app.typebot.io
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on caf5432 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

Please sign in to comment.