diff --git a/apps/hq/Dockerfile b/apps/hq/Dockerfile index 9a66ceeab3..48e02b6f80 100644 --- a/apps/hq/Dockerfile +++ b/apps/hq/Dockerfile @@ -1,9 +1,10 @@ # Add lockfile and package.json's of isolated subworkspace -FROM node:16-alpine AS installer +FROM --platform=linux/amd64 node:16-alpine AS installer +WORKDIR /app + RUN apk update RUN apk --no-cache add curl libc6-compat RUN curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; -WORKDIR /app # First install the dependencies (as they change less often) COPY . . @@ -11,10 +12,11 @@ RUN pnpm install # Build the project RUN pnpm dlx prisma generate -RUN pnpm turbo run build --filter=web... +RUN pnpm turbo run build --filter=hq... -FROM node:16-alpine AS runner +FROM --platform=linux/amd64 node:16-alpine AS runner +RUN apk update RUN apk --no-cache add curl libc6-compat RUN curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm; @@ -25,14 +27,12 @@ USER nextjs WORKDIR /home/nextjs -COPY --from=installer /app/apps/web/next.config.js . -COPY --from=installer /app/apps/web/package.json . +COPY --from=installer /app/apps/hq . -# 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/prisma/schema.prisma ./packages/database/prisma/schema.prisma -CMD pnpm dlx prisma migrate deploy && node apps/web/server.js \ No newline at end of file +USER nextjs + +EXPOSE 3000 + +CMD pnpm dlx prisma migrate deploy && pnpm start --filter=hq... \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f798ea34e9..89e4c5eaad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: environment: - POSTGRES_PASSWORD=postgres - hostr: + formbricks-hq: build: context: . dockerfile: ./apps/hq/Dockerfile diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00c24b9142..f70f40cfd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -102,7 +102,6 @@ importers: nextjs-cors: ^2.1.2 nodemailer: ^6.8.0 postcss: ^8.4.19 - posthog-node: ^2.2.2 prismjs: ^1.29.0 react: ^18.2.0 react-dom: ^18.2.0 @@ -125,7 +124,6 @@ importers: next-auth: 4.17.0_2xoejpawkzgot77rbv5mbik6ve nextjs-cors: 2.1.2_next@13.0.5 nodemailer: 6.8.0 - posthog-node: 2.2.2 prismjs: 1.29.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -5580,6 +5578,7 @@ packages: /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true /at-least-node/1.0.0: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} @@ -5626,15 +5625,6 @@ packages: engines: {node: '>=4'} dev: false - /axios/0.27.2: - resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} - dependencies: - follow-redirects: 1.15.2 - form-data: 4.0.0 - transitivePeerDependencies: - - debug - dev: false - /axobject-query/2.2.0: resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} dev: false @@ -6700,6 +6690,7 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 + dev: true /comma-separated-tokens/1.0.8: resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} @@ -7386,6 +7377,7 @@ packages: /delayed-stream/1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + dev: true /delegates/1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -8912,16 +8904,6 @@ packages: readable-stream: 2.3.7 dev: true - /follow-redirects/1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false - /for-in/1.0.2: resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} engines: {node: '>=0.10.0'} @@ -9004,15 +8986,6 @@ packages: mime-types: 2.1.35 dev: true - /form-data/4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - /forwarded/0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -13249,15 +13222,6 @@ packages: source-map-js: 1.0.2 dev: true - /posthog-node/2.2.2: - resolution: {integrity: sha512-aXYe/D+28kF63W8Cz53t09ypEORz+ULeDCahdAqhVrRm2scbOXFbtnn0GGhvMpYe45grepLKuwui9KxrZ2ZuMw==} - engines: {node: '>=14.17.0'} - dependencies: - axios: 0.27.2 - transitivePeerDependencies: - - debug - dev: false - /preact-render-to-string/5.2.6_preact@10.11.3: resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} peerDependencies: