Skip to content

Commit

Permalink
build: cleanup [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Sep 10, 2023
1 parent e54a43b commit ae72943
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
!.git
!.gitignore
!.npmrc
!turbo.json
!/package.json
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ ARG SCOPE=playground
# Stage 0: base image #
###################################################################
FROM node:20-slim AS base
RUN apk add --no-cache git
ENV GIT_SSL_NO_VERIFY 1
RUN apt-get update && apt-get install -y --no-install-recommends git tini

ARG SCOPE
ENV SCOPE=${SCOPE}
Expand Down Expand Up @@ -48,6 +49,7 @@ RUN pnpm install

# Build the project
COPY --from=pruner /app/out/full/ .
COPY --from=pruner /app/.git .git
COPY turbo.json turbo.json

# Uncomment and use build args to enable remote caching
Expand All @@ -58,7 +60,7 @@ COPY turbo.json turbo.json
# ENV TURBO_TOKEN=$TURBO_TOKEN

# TODO: set any extra ENV needed for build
# ENV ENCRYPTION_SECRET=encryption_secret_placeholder123 DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot NEXTAUTH_URL=http://localhost:3000 NEXT_PUBLIC_VIEWER_URL=http://localhost:3001
# ENV ENCRYPTION_SECRET=encryption_secret_placeholder123 NEXTAUTH_URL=http://localhost:3000 NEXT_PUBLIC_VIEWER_URL=http://localhost:3001
RUN pnpm turbo run build --filter=${SCOPE}...

###################################################################
Expand All @@ -70,10 +72,13 @@ FROM cgr.dev/chainguard/node:20 AS runner
# FROM base AS runner

WORKDIR /app
ENTRYPOINT ["/usr/bin/node"]
ENV NODE_ENV production
ARG SCOPE

# copy tini
COPY --from=base /usr/bin/tini /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "-s", "--", "/usr/bin/node"]

# copy runtime needed config files???
COPY --from=builder /app/apps/${SCOPE}/package.json .
# COPY --from=builder --chown=node:node /app/config ./config
Expand Down

0 comments on commit ae72943

Please sign in to comment.