jackson/Dockerfile

70 lines
2.1 KiB
Docker
Raw Permalink Normal View History

2024-05-14 15:30:25 +00:00
ARG NODEJS_IMAGE=node:20.13.1-alpine3.19
FROM --platform=$BUILDPLATFORM $NODEJS_IMAGE AS base
2021-09-16 11:52:32 +00:00
# Install dependencies only when needed
FROM base AS deps
2021-09-16 11:52:32 +00:00
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json package-lock.json ./
COPY npm npm
Add `@boxyhq/internal-ui` (#2305) * add WellKnownURLs * Fix translation keys * Update dependencies and add IdP Configuration * Update common.json with new translations * wip * Update @boxyhq/internal-ui version to 0.0.5 * add internal ui folder * Fix imports and build * Refactor internal-ui package structure * wip shared UI * Fix the build * Add new components and hooks for directory sync * lint fix * updated swr * users * Refactor shared components and fix API endpoints*** ***Update directory user page and add new federated SAML app * Fix lint * wip * Add new files and update existing files * Refactor DirectoryGroups and DirectoryInfo components * Update localization strings for directory UI * Update Google Auth URL description in common.json * Refactor directory tab and add delete functionality to webhook logs * Delete unused files and update dependencies * Fix column declaration * Add internal-ui/dist to .gitignore * Update page limit and add new dependencies * wip * Refactor directory search in user API endpoint * wip * Refactor directory retrieval logic in user and group API handlers * Add API endpoints for retrieving webhook events * Add query parameters to API URLs in DirectoryGroups * Add Google authorization status badge and handle pagination in FederatedSAMLApps * Add router prop to AppsList component and update page header titles * UI changes * Add new files and export functions * Remove unused router prop * Add PencilIcon to FederatedSAMLApps * Refactor FederatedSAMLApps and NewFederatedSAMLApp components * lint fix * add jose npm to dev dep * added missing strings * locale strings fix * locale strings cleanup * update package-lock * Add prepublish step * Build and publish npm and internal ui * Refactor install step * Run npm install (for local) inside internal ui automatically using prepare * Remove eslint setup for internal-ui * Add `--legacy-peer-deps` to prevent installing peer dependencies * Fix the types import path * wip * wip * Fix the types * Format * Update package-lock * Cleanup * Try adding jose library version 5.2.2 * COPY internal-ui before npm install * COPY internal-ui in builder stage * fixed sort order for jose --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-02-27 22:12:39 +00:00
COPY internal-ui internal-ui
Feature/typeorm migrations (#141) * updated typeorm * renamed connection * updated migration scripts to new TypeORM version (v3) * typeorm and mongo -migrations and namespace column * update the mongo migration file * remove the camelcase * remove camelcase * rename the file * renaming migration files * folder restructuring and add migrate-mongo package * correcting path and minor changes * merging db name with URL * changing ts to js for mongo * migration automation with env variable * using custom scripts for migration * Dockerfile fixes * bootstrap script fixes and still need ts-node migrate-mongo in dockerfile * running migration in CI/CD * turning down planetscale * migration related fixes for namespace * Migration & bootstrap changes * reverting minor change * bootstrap.sh will only run in docker env * bootstrap RUN_MIGRATION env variable will use true * migration fixes * migration changes * removed console logs * planetscale migration fixes * copied back old files, tweaks to filenames * add index for namespace * restore older migration scripts * formatting * aligned timestamps * updated mysql, mariadb, mssql, planetscale namespace migrations * We'll run migrate manually as a separate step/container * forgot to add migrate.sh * bumped up timestamp * Enable planetscale testing * Revert planetscale test and comment config object * Revert deletions in Dockerfile * Update maria, mssql, mysql, ps, pg, sql namespace migrations * Cleanup * Add runMigration env to support manual run * Minor tweak * Ensure sql data migrations run after schema changes * Fix mssql namespace data migration query * Sync lock file * Update mongo timestamp * Set env for npm mongo migration script * [sql] Populate namespace column for synchronize: true instances * Rename `DB_RUN_MIGRATION` -> `DB_MANUAL_MIGRATION` * [mongo] Populate namespace for already deployed instances * Cleanup migrate.sh * [bash -> sh] bash does not work inside docker * Optimise migration artifacts * Source packages from global path * Copy npm from build context - excludes node_modules via .dockerignore * Remove redundant copy step * added swc packages * fresh package-lock * fresh package-lock * added migratepg job to skaffold fixes in migrate.sh to exit with error when migration fails * cleanup * added migratepg to demo skaffold as well * turn on planetscale tests --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Utkarsh Mehta <ukrocks.mehta@gmail.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-10-13 22:29:21 +00:00
COPY migrate.sh prebuild.ts ./
RUN npm install
RUN npm rebuild --arch=x64 --platform=linux --libc=musl sharp
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/npm ./npm
Add `@boxyhq/internal-ui` (#2305) * add WellKnownURLs * Fix translation keys * Update dependencies and add IdP Configuration * Update common.json with new translations * wip * Update @boxyhq/internal-ui version to 0.0.5 * add internal ui folder * Fix imports and build * Refactor internal-ui package structure * wip shared UI * Fix the build * Add new components and hooks for directory sync * lint fix * updated swr * users * Refactor shared components and fix API endpoints*** ***Update directory user page and add new federated SAML app * Fix lint * wip * Add new files and update existing files * Refactor DirectoryGroups and DirectoryInfo components * Update localization strings for directory UI * Update Google Auth URL description in common.json * Refactor directory tab and add delete functionality to webhook logs * Delete unused files and update dependencies * Fix column declaration * Add internal-ui/dist to .gitignore * Update page limit and add new dependencies * wip * Refactor directory search in user API endpoint * wip * Refactor directory retrieval logic in user and group API handlers * Add API endpoints for retrieving webhook events * Add query parameters to API URLs in DirectoryGroups * Add Google authorization status badge and handle pagination in FederatedSAMLApps * Add router prop to AppsList component and update page header titles * UI changes * Add new files and export functions * Remove unused router prop * Add PencilIcon to FederatedSAMLApps * Refactor FederatedSAMLApps and NewFederatedSAMLApp components * lint fix * add jose npm to dev dep * added missing strings * locale strings fix * locale strings cleanup * update package-lock * Add prepublish step * Build and publish npm and internal ui * Refactor install step * Run npm install (for local) inside internal ui automatically using prepare * Remove eslint setup for internal-ui * Add `--legacy-peer-deps` to prevent installing peer dependencies * Fix the types import path * wip * wip * Fix the types * Format * Update package-lock * Cleanup * Try adding jose library version 5.2.2 * COPY internal-ui before npm install * COPY internal-ui in builder stage * fixed sort order for jose --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-02-27 22:12:39 +00:00
COPY --from=deps /app/internal-ui ./internal-ui
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1
RUN npm run build
2021-09-16 11:52:32 +00:00
# Production image, copy all the files and run next
FROM $NODEJS_IMAGE AS runner
2021-09-16 11:52:32 +00:00
WORKDIR /app
2021-09-16 09:48:24 +00:00
ENV NODE_OPTIONS="--max-http-header-size=81920 --dns-result-order=ipv4first"
2021-09-16 10:14:33 +00:00
ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
2021-09-16 09:48:24 +00:00
COPY --from=builder /app/public ./public
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
Feature/typeorm migrations (#141) * updated typeorm * renamed connection * updated migration scripts to new TypeORM version (v3) * typeorm and mongo -migrations and namespace column * update the mongo migration file * remove the camelcase * remove camelcase * rename the file * renaming migration files * folder restructuring and add migrate-mongo package * correcting path and minor changes * merging db name with URL * changing ts to js for mongo * migration automation with env variable * using custom scripts for migration * Dockerfile fixes * bootstrap script fixes and still need ts-node migrate-mongo in dockerfile * running migration in CI/CD * turning down planetscale * migration related fixes for namespace * Migration & bootstrap changes * reverting minor change * bootstrap.sh will only run in docker env * bootstrap RUN_MIGRATION env variable will use true * migration fixes * migration changes * removed console logs * planetscale migration fixes * copied back old files, tweaks to filenames * add index for namespace * restore older migration scripts * formatting * aligned timestamps * updated mysql, mariadb, mssql, planetscale namespace migrations * We'll run migrate manually as a separate step/container * forgot to add migrate.sh * bumped up timestamp * Enable planetscale testing * Revert planetscale test and comment config object * Revert deletions in Dockerfile * Update maria, mssql, mysql, ps, pg, sql namespace migrations * Cleanup * Add runMigration env to support manual run * Minor tweak * Ensure sql data migrations run after schema changes * Fix mssql namespace data migration query * Sync lock file * Update mongo timestamp * Set env for npm mongo migration script * [sql] Populate namespace column for synchronize: true instances * Rename `DB_RUN_MIGRATION` -> `DB_MANUAL_MIGRATION` * [mongo] Populate namespace for already deployed instances * Cleanup migrate.sh * [bash -> sh] bash does not work inside docker * Optimise migration artifacts * Source packages from global path * Copy npm from build context - excludes node_modules via .dockerignore * Remove redundant copy step * added swc packages * fresh package-lock * fresh package-lock * added migratepg job to skaffold fixes in migrate.sh to exit with error when migration fails * cleanup * added migratepg to demo skaffold as well * turn on planetscale tests --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Utkarsh Mehta <ukrocks.mehta@gmail.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-10-13 22:29:21 +00:00
# Support for DB migration
COPY --from=builder --chown=nextjs:nodejs /app/migrate.sh ./migrate.sh
COPY npm npm
RUN chmod +x migrate.sh
# mongodb peer dependency would be automatically installed for migrate-mongo
RUN npm install -g ts-node migrate-mongo typeorm reflect-metadata mssql mysql2 pg
USER nextjs
2021-09-16 09:48:24 +00:00
EXPOSE 5225
2021-09-16 09:48:24 +00:00
ENV PORT 5225
CMD ["node", "server.js"]