mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-20 05:20:15 -06:00
* fix: docker env parsing & response bug when built w docker * chore: bring back env example * fix: docker compose envs are now single place defined * add: renaming of .env in docs * remove: existence of prisma_generate_data_proxy * fix: use newer env vars and a smarter way to handle existing .env file * fix: remove text to remove existing .enb * fix: remove comments, local testing, and mention of more updating via echo in prod script * fix: env ending * fix: finalllyyy the docker compose works * feat: short survey url support in docker compose * fix: add envs to prod script * chore: reorder env vars for uniformity * update description for SHORT_SURVEY_BASE_URL * fix: add ASSET_PREFIX_URL to prod script & docker compose --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
53 lines
1.6 KiB
Docker
53 lines
1.6 KiB
Docker
FROM node:18-alpine AS installer
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
ARG DATABASE_URL
|
|
ENV DATABASE_URL=$DATABASE_URL
|
|
|
|
ARG NEXTAUTH_SECRET
|
|
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
RUN touch /app/apps/web/.env
|
|
|
|
|
|
RUN pnpm install
|
|
|
|
# Build the project
|
|
RUN pnpm post-install --filter=web...
|
|
RUN pnpm turbo run build --filter=web...
|
|
|
|
FROM node:18-alpine AS runner
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
# Don't run production as root
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
USER nextjs
|
|
|
|
WORKDIR /home/nextjs
|
|
|
|
COPY --from=installer /app/apps/web/next.config.mjs .
|
|
COPY --from=installer /app/apps/web/package.json .
|
|
|
|
# Automatically leverage output traces to reduce image size
|
|
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
|
|
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
|
|
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
|
|
COPY --from=installer --chown=nextjs:nodejs /app/packages/database/schema.prisma ./packages/database/schema.prisma
|
|
COPY --from=installer --chown=nextjs:nodejs /app/packages/database/migrations ./packages/database/migrations
|
|
|
|
EXPOSE 3000
|
|
|
|
ENV HOSTNAME "0.0.0.0"
|
|
|
|
CMD if [ "$NEXTAUTH_SECRET" != "RANDOM_STRING" ]; then \
|
|
pnpm dlx prisma migrate deploy && node apps/web/server.js; \
|
|
else \
|
|
echo "ERROR: Please set a value for NEXTAUTH_SECRET in your docker compose variables!"; \
|
|
exit 1; \
|
|
fi
|