Skip to content

Commit

Permalink
improve Dockerfile size and safety
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDen authored and baptisteArno committed Jul 7, 2022
1 parent 50ab2a9 commit 9839f5c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ ENV SCOPE=${SCOPE}
FROM base AS pruner
RUN yarn global add turbo@1.2.9
COPY . .
RUN turbo prune --scope=${SCOPE} --docker
RUN turbo prune --scope="${SCOPE}" --docker

FROM base AS installer
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/yarn.lock ./yarn.lock
RUN yarn install --frozen-lockfile

FROM base AS builder
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=installer /app/ .
COPY --from=pruner /app/out/full/ .
COPY ./apps/${SCOPE}/.env.docker ./apps/${SCOPE}/.env.production
COPY ./apps/${SCOPE}/.env.docker ./apps/${SCOPE}/.env.local
RUN apt-get -qy update && apt-get -qy install openssl
RUN yarn turbo run build --scope=${SCOPE} --include-dependencies --no-deps
RUN apt-get -qy update && apt-get -qy --no-install-recommends install openssl
RUN yarn turbo run build --scope="${SCOPE}" --include-dependencies --no-deps
RUN find . -name node_modules | xargs rm -rf

FROM base AS runner
Expand All @@ -34,13 +35,17 @@ COPY --from=builder /app/apps/${SCOPE}/package.json ./package.json
COPY --from=builder /app/apps/${SCOPE}/.next/standalone ./
COPY --from=builder /app/apps/${SCOPE}/.next/static ./.next/static
COPY --from=builder /app/apps/${SCOPE}/.env.docker ./.env.production
RUN apt-get -qy update && apt-get -qy install openssl
RUN apt-get -qy update \
&& apt-get -qy --no-install-recommends install \
openssl \
&& apt-get autoremove -yq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY env.sh ./
COPY ${SCOPE}-entrypoint.sh ./
RUN chmod +x ./${SCOPE}-entrypoint.sh
RUN chmod +x ./env.sh
ENTRYPOINT ./${SCOPE}-entrypoint.sh
COPY env.sh ${SCOPE}-entrypoint.sh ./
RUN chmod +x ./"${SCOPE}"-entrypoint.sh \
&& chmod +x ./env.sh
ENTRYPOINT ./"${SCOPE}"-entrypoint.sh

EXPOSE 3000
ENV PORT 3000
ENV PORT 3000

4 comments on commit 9839f5c

@vercel
Copy link

@vercel vercel bot commented on 9839f5c Jul 7, 2022

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-alpha – ./apps/viewer

bot.aipr.kr
8jours.top
am.nigerias.io
vhpage.cr8.ai
an.nigerias.io
bot.aws.bj
bt.id8rs.com
sat.cr8.ai
bot.lalmon.com
ar.nigerias.io
apr.nigerias.io
apo.nigerias.io
eventhub.com.au
aso.nigerias.io
chat.sureb4.com
sakuranembro.it
games.klujo.com
bot.piccinato.co
bot.upfunnel.art
clo.closeer.work
faqs.nigerias.io
feedback.ofx.one
stan.vselise.com
voicehelp.cr8.ai
app.chatforms.net
bot.maitempah.com
gentleman-shop.fr
k1.kandabrand.com
bot.agfunnel.tech
ov1.wpwakanda.com
ov2.wpwakanda.com
ov3.wpwakanda.com
this-is-a-test.com
goalsettingbot.com
carsalesenquiry.com
bot.eventhub.com.au
zap.techadviser.in
forms.webisharp.com
typebot.stillio.com
order.maitempah.com
bot.ansuraniphone.my
chat.hayurihijab.com
bot.cotemeuplano.com
get.freebotoffer.xyz
aidigitalmarketing.kr
bot.meuesocial.com.br
abutton.wpwakanda.com
bbutton.wpwakanda.com
bot.incusservices.com
cdd.searchcube.com.sg
chat.missarkansas.org
sbutton.wpwakanda.com
bbutton.wpwwakanda.com
apply.ansuraniphone.my
c23111azqw.nigerias.io
felipewelington.com.br
form.searchcube.com.sg
kodawariab736.skeep.it
info.clickasuransi.com
report.gratirabbit.com
resume.gratirabbit.com
gcase.barrettamario.it
view.onlinebotdemo.xyz
83242573.actualizar.xyz
subfooter.wpwakanda.com
bot.upgradesolutions.eu
mainmenu.diddancing.com
form.sergiolimajr.com.br
91181264.your-access.one
hunterbot.saleshunter.ai
aibot.angrybranding.co.uk
type.opaulovieira.com.br
bot.aidigitalmarketing.kr
bot.cabinrentalagency.com
boyfriend-breakup.riku.ai
type.dericsoncalari.com.br
sellmyharleylouisiana.com
designguide.techyscouts.com
piazzatorre.barrettamario.it
presente.empresarias.com.mx
onboarding.libertydreamcare.ie
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
bookings.littlepartymonkeys.com
bot.comercializadoraomicron.com
personal-trainer.barrettamario.it
viewer-v2-alpha-typebot-io.vercel.app
viewer-v2-alpha-git-main-typebot-io.vercel.app
studiotecnicoimmobiliaremerelli.it
preagendamento.sergiolimajr.com.br

@vercel
Copy link

@vercel vercel bot commented on 9839f5c Jul 7, 2022

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 9839f5c Jul 7, 2022

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 9839f5c Jul 7, 2022

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-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app
docs.typebot.io

Please sign in to comment.