A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
fix: remove unnecessary complex copy and build steps in dockerfile (#1595)
Meier Lukas2686dad63017
diff --git a/Dockerfile b/Dockerfileindex a4b96bff8..443a7ce08 100644--- a/Dockerfile+++ b/Dockerfile@@ -6,46 +6,15 @@ RUN apk update# Set working directoryWORKDIR /app-COPY . .-RUN npm i -g turbo-RUN turbo prune @homarr/nextjs --docker --out-dir ./next-out-RUN turbo prune @homarr/tasks --docker --out-dir ./tasks-out-RUN turbo prune @homarr/websocket --docker --out-dir ./websocket-out-RUN turbo prune @homarr/db --docker --out-dir ./migration-out-RUN turbo prune @homarr/cli --docker --out-dir ./cli-out--# Add lockfile and package.json's of isolated subworkspace-FROM base AS installerRUN apk add --no-cache libc6-compat curl bashRUN apk update-WORKDIR /app--# First install the dependencies (as they change less often)-COPY .gitignore .gitignore--COPY --from=builder /app/tasks-out/json/ .-COPY --from=builder /app/websocket-out/json/ .-COPY --from=builder /app/migration-out/json/ .-COPY --from=builder /app/cli-out/json/ .-COPY --from=builder /app/next-out/json/ .-COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml--# Is used for postinstall of docs definitions-COPY --from=builder /app/packages/definitions/src/docs ./packages/definitions/src/docs+COPY . .-# Uses the lockfile to install the dependenciesRUN corepack enable pnpm && pnpm install --recursive --frozen-lockfile# Install sharp for image optimizationRUN corepack enable pnpm && pnpm install sharp -w-# Build the project-COPY --from=builder /app/tasks-out/full/ .-COPY --from=builder /app/websocket-out/full/ .-COPY --from=builder /app/next-out/full/ .-COPY --from=builder /app/migration-out/full/ .-COPY --from=builder /app/cli-out/full/ .-# Copy static data as it is not part of the buildCOPY static-data ./static-dataARG SKIP_ENV_VALIDATION='true'@@ -69,7 +38,7 @@ RUN addgroup --system --gid 1001 nodejsRUN adduser --system --uid 1001 nextjs# Enable homarr cli-COPY --from=installer --chown=nextjs:nodejs /app/packages/cli/cli.cjs /app/apps/cli/cli.cjs+COPY --from=builder --chown=nextjs:nodejs /app/packages/cli/cli.cjs /app/apps/cli/cli.cjsRUN echo $'#!/bin/bash\ncd /app/apps/cli && node ./cli.cjs "$@"' > /usr/bin/homarrRUN chmod +x /usr/bin/homarr@@ -83,20 +52,20 @@ RUN mkdir -p /var/cache/nginx && chown -R nextjs:nodejs /var/cache/nginx && \mkdir -p /etc/nginx/templates /etc/nginx/ssl/certs && chown -R nextjs:nodejs /etc/nginxUSER nextjs-COPY --from=installer /app/apps/nextjs/next.config.mjs .-COPY --from=installer /app/apps/nextjs/package.json .+COPY --from=builder /app/apps/nextjs/next.config.mjs .+COPY --from=builder /app/apps/nextjs/package.json .-COPY --from=installer --chown=nextjs:nodejs /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs-COPY --from=installer --chown=nextjs:nodejs /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs-COPY --from=installer --chown=nextjs:nodejs /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node+COPY --from=builder --chown=nextjs:nodejs /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs+COPY --from=builder --chown=nextjs:nodejs /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs+COPY --from=builder --chown=nextjs:nodejs /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node-COPY --from=installer --chown=nextjs:nodejs /app/packages/db/migrations ./db/migrations+COPY --from=builder --chown=nextjs:nodejs /app/packages/db/migrations ./db/migrations# 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/nextjs/.next/standalone ./-COPY --from=installer --chown=nextjs:nodejs /app/apps/nextjs/.next/static ./apps/nextjs/.next/static-COPY --from=installer --chown=nextjs:nodejs /app/apps/nextjs/public ./apps/nextjs/public+COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/.next/standalone ./+COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/.next/static ./apps/nextjs/.next/static+COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/public ./apps/nextjs/publicCOPY --chown=nextjs:nodejs scripts/run.sh ./run.shCOPY --chown=nextjs:nodejs scripts/generateEncryptionKey.js ./generateEncryptionKey.jsCOPY --chown=nextjs:nodejs packages/redis/redis.conf /app/redis.conf