diff --git a/Dockerfile b/Dockerfile index 0efcdbae..dd81f2c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,15 +4,15 @@ FROM $BASE_IMAGE AS build WORKDIR /app COPY package.json package-lock.json ./ +COPY packages/server/package.json packages/server ./packages/server/ +COPY packages/home/package.json packages/home ./packages/home/ +COPY packages/admin/package.json packages/admin ./packages/admin/ RUN npm ci ENV NODE_ENV=production -COPY packages/server/src ./src -COPY tsconfig.* nest-cli.json ./ -RUN npm run build:server -COPY client ./client -RUN npm run build:client +COPY packages packages +RUN npm run build FROM $BASE_IMAGE AS dependencies @@ -20,6 +20,9 @@ FROM $BASE_IMAGE AS dependencies WORKDIR /app COPY package.json package-lock.json ./ +COPY packages/server/package.json packages/server ./packages/server/ +COPY packages/home/package.json packages/home ./packages/home/ +COPY packages/admin/package.json packages/admin ./packages/admin/ RUN npm ci --omit=dev FROM $BASE_IMAGE AS release @@ -30,8 +33,12 @@ WORKDIR /app COPY public public COPY --from=dependencies /app/node_modules ./node_modules -COPY --from=build /app/client/dist ./client/dist -COPY --from=build /app/dist ./dist +COPY --from=dependencies /app/packages/server/node_modules ./packages/server/node_modules +COPY --from=dependencies /app/packages/home/node_modules ./packages/home/node_modules +COPY --from=dependencies /app/packages/admin/node_modules ./packages/admin/node_modules +COPY --from=build /app/packages/server/dist ./packages/server/dist +COPY --from=build /app/packages/home/dist ./packages/home/dist +COPY --from=build /app/packages/admin/dist ./packages/admin/dist ENTRYPOINT ["/sbin/tini", "--"] -CMD ["node", "--enable-source-maps", "dist/main.js"] +CMD ["node", "--enable-source-maps", "packages/server/dist/main.js"]