update dockerfile to work with new folder structure

This commit is contained in:
Matthias Nannt
2023-01-15 14:10:20 +01:00
parent a86b9c6e19
commit 09c822c52e
2 changed files with 9 additions and 9 deletions

View File

@@ -6,13 +6,13 @@ WORKDIR /app
# First install the dependencies (as they change less often)
COPY . .
# Copy .env file because Docker don't follow symlinks
COPY .env /app/apps/hq/
COPY .env /app/apps/web/
RUN pnpm install
# Build the project
RUN pnpm dlx prisma generate
RUN pnpm turbo run build --filter=hq...
RUN pnpm turbo run build --filter=web...
FROM node:18-slim AS runner
RUN npm install -g pnpm
@@ -24,14 +24,14 @@ USER nextjs
WORKDIR /home/nextjs
COPY --from=installer /app/apps/hq/next.config.js .
COPY --from=installer /app/apps/hq/package.json .
COPY --from=installer /app/apps/web/next.config.js .
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/hq/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/hq/.next/static ./apps/hq/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/hq/public ./apps/hq/public
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 ./packages/database/prisma
CMD pnpm dlx prisma migrate deploy && node apps/hq/server.js
CMD pnpm dlx prisma migrate deploy && node apps/web/server.js

View File

@@ -10,7 +10,7 @@ services:
formbricks-hq:
build:
context: .
dockerfile: ./apps/hq/Dockerfile
dockerfile: ./apps/web/Dockerfile
depends_on:
- postgres
ports: