diff --git a/projects/backend/Dockerfile b/projects/backend/Dockerfile index 5214223..cba4eff 100644 --- a/projects/backend/Dockerfile +++ b/projects/backend/Dockerfile @@ -3,7 +3,7 @@ FROM oven/bun:1.1.31-alpine AS base # Install dependencies FROM base AS depends WORKDIR /app -COPY . . +COPY package.json bun.lockb* ./ RUN bun install --frozen-lockfile # Run the app @@ -17,12 +17,12 @@ COPY --from=depends /app/package.json* /app/bun.lockb* ./ COPY --from=depends /app/node_modules ./node_modules # Build the common library -COPY --from=depends /app/projects/common ./projects/common +COPY projects/common ./projects/common RUN bun i -g typescript RUN bun --filter '@ssr/common' build # Copy the backend project -COPY --from=depends /app/projects/backend ./projects/backend +COPY projects/backend ./projects/backend # Lint before starting RUN bun --filter 'backend' lint diff --git a/projects/website/Dockerfile b/projects/website/Dockerfile index b4322c5..c45433c 100644 --- a/projects/website/Dockerfile +++ b/projects/website/Dockerfile @@ -3,7 +3,7 @@ FROM oven/bun:1.1.31-alpine AS base # Install dependencies FROM base AS depends WORKDIR /app -COPY . . +COPY package.json bun.lockb* ./ RUN bun install --frozen-lockfile # Run the app @@ -20,12 +20,12 @@ COPY --from=depends /app/package.json* /app/bun.lockb* ./ COPY --from=depends /app/node_modules ./node_modules # Build the common library -COPY --from=depends /app/projects/common ./projects/common +COPY projects/common ./projects/common RUN bun i -g typescript RUN bun --filter '@ssr/common' build # Copy the website project -COPY --from=depends /app/projects/website ./projects/website +COPY projects/website ./projects/website # Build the website RUN bun run --filter website build