diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 7ce3d94..0000000 --- a/.dockerignore +++ /dev/null @@ -1,99 +0,0 @@ -# Dependencies -node_modules -**/node_modules -.pnpm-store - -# Build outputs -.next -**/.next -.output -**/.output -out -**/out -dist -**/dist -build -**/build - -# Turborepo cache -.turbo -**/.turbo - -# Git -.git -**/.git -.gitignore -**/.gitignore - -# IDE -.idea -**/.idea -.vscode -**/.vscode -.cursor -**/.cursor -*.swp -**/*.swp -*.swo -**/*.swo - -# Environment files (use Docker env vars instead) -.env -**/.env -.env.* -**/.env.* -!.env.example -!**/.env.example - -# Test files -coverage -**/coverage -*.test.ts -**/*.test.ts -*.test.tsx -**/*.test.tsx -*.spec.ts -**/*.spec.ts -*.spec.tsx -**/*.spec.tsx -__tests__ -**/__tests__ - -# Documentation -docs -*.md -**/*.md -!README.md -!**/README.md - -# Docker (don't copy init scripts into build) -docker/init-scripts - -# Directories not needed in Docker builds -e2e -.getcito -**/.getcito -apps/cli - -# pnpm config (use-node-version breaks Alpine/MUSL Docker builds) -.npmrc - -# Misc -.DS_Store -**/.DS_Store -*.pem -**/*.pem -*.key -**/*.key -*.cert -**/*.cert -*.crt -**/*.crt -Thumbs.db -**/Thumbs.db -*.log -**/*.log -e2e/artifacts - -docker-compose.whitelabel.yml - diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 1aa6236..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,68 +0,0 @@ -# AGENTS.md - -## Cursor Cloud specific instructions - -### Project overview - -GetCito is an open-source AI visibility tracking platform (Answer Engine Optimization), forked from [Elmo](https://github.com/elmohq/elmo). It is a **pnpm monorepo** using **Turborepo**, **Node.js 24**, and **PostgreSQL 16**. - -Key apps: `apps/web` (TanStack Start dashboard, port 3000), `apps/worker` (pg-boss background jobs), `apps/cli` (deployment CLI). - -### Running services - -- **PostgreSQL**: Start with `sudo pg_ctlcluster 16 main start`. Verify with `pg_isready`. -- **Web app dev server**: From repo root, run with env vars loaded (see below). Uses Vite on port 3000. -- **Worker**: Reads env from `apps/web/.env` via `--env-file`. Only needed for background job processing (AI evaluations, reports). - -### Environment variables - -The `.env` file must exist at **both** the repo root AND `apps/web/.env` (Vite reads from its project root; the worker reads from `apps/web/.env` via `--env-file`). Required minimum for local mode: - -``` -DATABASE_URL=postgres://getcito:getcito@localhost:5432/getcito -DEPLOYMENT_MODE=local -VITE_DEPLOYMENT_MODE=local -BETTER_AUTH_SECRET= -APP_URL=http://localhost:3000 -VITE_APP_URL=http://localhost:3000 -DISABLE_TELEMETRY=1 -``` - -For the env validation to pass fully, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `DATAFORSEO_LOGIN`, and `DATAFORSEO_PASSWORD` must also be set. Placeholder values work for UI testing. - -### Database migrations - -Run from `packages/lib`: `DATABASE_URL=... npx drizzle-kit migrate` - -### Common commands - -See `README.md` for the full commands reference. Key ones: - -- `pnpm dev` — start all dev servers (turbo) -- `pnpm lint` — Biome linter (pre-existing CSS/Tailwind directive warnings are expected) -- `pnpm test` — Vitest unit tests -- `pnpm build` — build all packages -- `pnpm format` — format with Biome - -### Gotchas - -- **Changesets**: Keep changesets short and end-user focused (what changed in the product), not internal implementation details. -- **PR screenshots**: Do **not** commit before/after screenshots or one-off screenshot capture scripts to the repo. Add proof screenshots as PR artifacts (or attach in the PR description) instead. - -- **Node.js 24 required**: The repo enforces `engines.node: "24.x"`. Use `nvm use 24`. -- **Biome CSS lint warnings**: The linter reports Tailwind `@apply` directive warnings in CSS files — these are pre-existing and expected. -- **pnpm build warnings**: Some dependencies have ignored build scripts (sentry-cli, msw, protobufjs, vue-demi). This is configured via `pnpm.onlyBuiltDependencies` and `pnpm.ignoredBuiltDependencies` in root `package.json`. -- **E2E tests**: Require Playwright browsers (`pnpm exec playwright install`) and a running app instance. They are separate from unit tests. -- **Worker env loading**: The worker's `dev` script uses `--env-file=../web/.env`, so the env file must be in `apps/web/`. - -## Pull request guidelines - -- **Do not commit image artifacts** (screenshots, videos, Playwright reports) to the repo. Generate artifacts locally and embed them in the PR description via `` so they are uploaded automatically. -- **Prefer uploading screenshots as PR artifacts** inline in the PR description (avoid committing files or linking to agent dashboards). -- **Do not add "screenshot-only" tests** whose sole purpose is to produce PR images. If you add test coverage, make it a real assertion-based test that is valuable long-term. -- **Do not bump versions** (or add placeholder versions) unless the change explicitly requires a release/versioning action. - -## Changesets - -- When adding a Changeset, keep it **scoped to the packages actually affected**. -- If a non-package directory (like `e2e/`) breaks Changesets tooling, fix the tooling configuration rather than inventing versions. diff --git a/CLA.md b/CLA.md deleted file mode 100644 index 8727ec9..0000000 --- a/CLA.md +++ /dev/null @@ -1,36 +0,0 @@ -# Contributor License Agreement (CLA) - -## 1. Purpose of the CLA -Thank you for your interest in contributing to Getcito, an open-source project managed by GetCito (the "Company"). This Contributor License Agreement ("CLA") clarifies the intellectual property licenses granted with contributions. It protects you, the project, the Company, and its users. It does not change your right to use your own contributions for any other purpose. - -## 2. Copyright Ownership -You retain copyright ownership, title, and all other rights and interests in your contributions, except for the license specifically granted to the project under this agreement. - -## 3. License Granted to the Project -You hereby grant to the Company and all recipients of the software distributed by the Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works. - -## 4. Patent Grant -Subject to the terms and conditions of this Agreement, you hereby grant to the Company and recipients of the software a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the project. This applies only to those patent claims licensable by you that are necessarily infringed by your contributions alone or by combination with the project. - -## 5. Right to Modify Contributions -The Company reserves the right to review, accept, modify, or reject any contribution submitted to the project. You acknowledge that your contribution may be modified, adapted, or combined with other code within the project. - -## 6. Contributor Representations -You represent that you are legally entitled to grant this license. If your employer has rights to the intellectual property you create, you represent that you have received permission to make contributions on behalf of that employer, that your employer has waived such rights for your contributions, or that your employer has executed a separate Corporate CLA. - -## 7. Original Work Declaration -You represent that each of your contributions is your original creation. You also represent that your submissions include complete details of any third-party license or other restrictions (including patents and trademarks) of which you are aware. - -## 8. Third-Party Code Declaration -Should you wish to submit work that is not your original creation, you may submit it to the Company separately from any contribution, identifying the complete details of its source and any license or other restrictions. Such work must be conspicuously marked as "Submitted on behalf of a third-party: [named here]". - -## 9. Legal Disclaimer -You are not expected to provide support for your contributions. Unless required by applicable law or agreed to in writing, you provide your contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. - -## 10. Acceptance Process -You can sign this CLA as part of your first contribution pull request. No separate sign-up step is required. -1. Add your GitHub username (lowercase, on its own line) to [`.github/contributors.txt`](.github/contributors.txt). -2. The PR must be opened from your own GitHub account. The merged commit acts as your electronic signature. - -## 11. Contact -For any legal inquiries or questions regarding this CLA, please contact the maintainers at [team@getcito.com](mailto:team@getcito.com). \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 12a1ecd..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,35 +0,0 @@ -# Code of Conduct - -## Our Pledge - -We as contributors and maintainers pledge to make participation in the Getcito project a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to a positive environment: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall community - -Examples of unacceptable behavior: - -- The use of sexualized language or imagery, and sexual attention or advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a professional setting - -## Enforcement - -The Getcito repository maintainers are responsible for enforcing this Code of Conduct. Maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct, and may **warn, temporarily ban, or permanently ban** any contributor for behaviors they deem inappropriate, threatening, offensive, or harmful. - -## Reporting - -If you experience or witness behavior that violates this Code of Conduct, please report it by emailing [team@getcito.com](mailto:team@getcito.com). - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant, version 2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/), condensed for our project. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e12474d..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,156 +0,0 @@ -# Contributing to Getcito - -## Welcome - -Thank you for your interest in contributing to Getcito! We welcome developers, designers, and enthusiasts to help us build a better open-source AEO and GEO platform. Whether you are fixing a bug, writing documentation, or proposing new features, your contributions are highly valued. - -For minor fixes, feel free to open a pull request directly. For larger architectural changes or major features, please open an issue first so we can discuss the approach before you begin coding. - -## Ways to Contribute - -There are many ways you can contribute to the project, including but not limited to: -- **Bug reports**: Identify and report issues in our issue tracker. -- **Feature requests**: Propose new functionalities or enhancements. -- **Documentation improvements**: Fix typos, clarify guides, or write tutorials. -- **Code contributions**: Fix bugs or implement new features. -- **Performance improvements**: Optimize database queries, reduce bundle sizes, or speed up processing. -- **Security improvements**: Identify vulnerabilities and responsibly disclose them. -- **Tests**: Expand our unit (Vitest) and E2E (Playwright) test coverage. -- **Refactoring**: Clean up code and improve architecture. -- **Examples**: Build out use cases or provide sample configurations. -- **UI/UX improvements**: Improve dashboard accessibility, design, and usability. - -## Development Setup - -Getcito is a Turborepo monorepo using `pnpm` and Node.js 24. - -1. **Clone the repository** - ```bash - git clone https://github.com/ai-search-guru/getcito-worlds-first-open-source-aio-aeo-or-geo-tool.git - cd getcito-worlds-first-open-source-aio-aeo-or-geo-tool - ``` - -2. **Configure environment** - Create a `.env.local` file by copying the template. Fill in your necessary API keys and set `DEPLOYMENT_MODE=local`. - ```bash - cp .env.example .env.local - cp .env.local .env - cp apps/web/.env.local apps/web/.env - ``` - -3. **Install dependencies** - Ensure you have Node.js 24 installed. We recommend using `nvm`. - ```bash - nvm use 24 - corepack enable pnpm - pnpm install - ``` - -4. **Start the development server** - Use Turborepo to start all development servers concurrently. - ```bash - pnpm dev - ``` - -5. **Run tests** - ```bash - pnpm test # Run unit tests - pnpm test:e2e # Run end-to-end tests - ``` - -6. **Build the project** - ```bash - pnpm build - ``` - -## Branch Naming Convention - -Please use descriptive branch names based on the following prefixes: -- `feature/` - For new features -- `fix/` - For bug fixes -- `docs/` - For documentation updates -- `refactor/` - For code restructuring without behavior changes -- `test/` - For adding or updating tests -- `chore/` - For maintenance tasks, dependency updates, etc. -- `hotfix/` - For urgent production fixes - -## Commit Message Convention - -We strictly follow Conventional Commits for our commit messages. This helps us auto-generate changelogs and release notes. - -**Examples:** -- `feat: add Google AI Mode scraping provider` -- `fix: resolve hydration error on prompt dashboard` -- `docs: update deployment prerequisites` -- `style: format trailing commas` -- `refactor: extract chart components to ui package` -- `perf: optimize postgres prompt querying` -- `test: add playwright cases for auth flow` -- `build: update dockerfile node version` -- `ci: migrate to new GitHub action runner` -- `chore: bump dependencies in workspace` - -## Pull Request Process - -1. **Fork the repository** to your own GitHub account. -2. **Create a branch** using our branch naming conventions. -3. **Keep commits clean** and logical using Conventional Commits. -4. **Run linting and formatting** locally using Biome: - ```bash - pnpm lint - pnpm format - ``` -5. **Run tests** (`pnpm test`) to ensure you haven't broken existing functionality. -6. **Update documentation** if your changes impact the setup, CLI, or UI. -7. **Submit a Pull Request** against the `main` branch. - *(Note: For your first PR, sign the CLA by adding your username to `.github/contributors.txt`)* -8. **Address review comments** promptly and push updates to the same branch. - -## Coding Standards - -- **Formatting & Linting**: We use [Biome](https://biomejs.dev/). Do not use Prettier or ESLint. Run `pnpm format` before committing. -- **Naming Conventions**: Use `camelCase` for variables and functions, `PascalCase` for React components and Types/Interfaces, and `kebab-case` for file names. -- **Folder Structure**: Follow the Turborepo standard. UI components go in `packages/ui`, database logic in `packages/lib`, and route pages in `apps/web/src/routes`. -- **Testing Expectations**: New features must include Vitest unit tests. Critical UI paths must be covered by Playwright E2E tests. -- **Documentation Expectations**: If you introduce a new environment variable, it must be added to `packages/config/src/env-registry.ts` and documented in the `README.md`. - -## Reporting Issues - -When reporting an issue, please include: -- A clear, descriptive title. -- Steps to reproduce the bug. -- Expected vs. actual behavior. -- Context (OS, Browser, Node.js version, deployment mode). -- Screenshots or logs if applicable. - -## Code Review Expectations - -- **Review Process**: PRs will be reviewed by at least one core maintainer. We aim to review PRs within a few business days. -- **Required Approvals**: 1 maintainer approval is required before merging. All CI checks (lint, test, typecheck) must pass. -- **Quality Expectations**: Code must be typed (no `any`), well-documented, formatted, and strictly scoped to the PR's stated objective. - -## Community Guidelines - -We expect all contributors to maintain a respectful, inclusive, and collaborative environment. Be kind, provide constructive feedback, and assume positive intent. By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). - -## Project Maintainers - -This project is actively maintained by: - -### AI Search Guru - -GitHub: -https://github.com/ai-search-guru - -### Sachiiinnn - -GitHub: -https://github.com/sachiiinnn - -They are the primary maintainers responsible for: -- Reviewing pull requests -- Managing releases -- Maintaining project quality -- Reviewing architectural decisions -- Maintaining documentation -- Guiding the project roadmap diff --git a/biome.json b/biome.json deleted file mode 100644 index 64076af..0000000 --- a/biome.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.4.4/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": false, - "includes": ["apps/**", "packages/**", "!**/node_modules/**", "!packages/ui/src/components/**"] - }, - "formatter": { - "enabled": true, - "indentStyle": "tab", - "lineWidth": 120 - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - } -} diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index d1ed75b..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,87 +0,0 @@ -# GetCito — local deploy, built from source. -# -# Usage (from repo root): -# cp .env.example .env # then fill in real values -# docker compose build -# docker compose up -d -# - -services: - postgres: - # New deployments get 18. Existing PostgreSQL 16 data directories are not - # compatible: set POSTGRES_IMAGE_TAG=16-alpine before upgrading, then remove - # the pin only after a dump/restore into PostgreSQL 18. - image: postgres:${POSTGRES_IMAGE_TAG:-18-alpine} - ports: - - "127.0.0.1:5433:5432" - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: getcito - volumes: - - postgres_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] - interval: 5s - timeout: 5s - retries: 5 - - adminer: - image: adminer - restart: always - ports: - - "8081:8080" - environment: - ADMINER_DEFAULT_SERVER: postgres - start_period: 30s - - db-migrate: - pull_policy: build - build: - context: . - dockerfile: docker/Dockerfile - target: migrate - environment: - - DATABASE_URL=postgres://postgres:postgres@postgres:5432/getcito - depends_on: - postgres: - condition: service_healthy - - web: - pull_policy: build - build: - context: . - dockerfile: docker/Dockerfile - target: web - args: - # VITE_* values are baked into the client bundle at build time. - DEPLOYMENT_MODE: ${DEPLOYMENT_MODE:-local} - VITE_DEPLOYMENT_MODE: ${VITE_DEPLOYMENT_MODE:-local} - VITE_APP_TIMEZONE: ${VITE_APP_TIMEZONE:-} - VITE_APP_LOCALE: ${VITE_APP_LOCALE:-} - env_file: - - .env - ports: - - "3001:3000" - depends_on: - postgres: - condition: service_healthy - db-migrate: - condition: service_completed_successfully - - worker: - pull_policy: build - build: - context: . - dockerfile: docker/Dockerfile - target: worker - env_file: - - .env - depends_on: - postgres: - condition: service_healthy - db-migrate: - condition: service_completed_successfully - -volumes: - postgres_data: diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index ff9da43..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,131 +0,0 @@ -# Getcito -# Supports: web app (Nitro server) and worker - -# Base stage with Node.js -FROM node:24-bookworm-slim AS base -RUN corepack enable pnpm -RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* - -# Dependencies stage -FROM base AS deps -WORKDIR /app - -# Copy package files -COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ -COPY apps/web/package.json ./apps/web/ -COPY apps/worker/package.json ./apps/worker/ -COPY packages/ui/package.json ./packages/ui/ -COPY packages/config/package.json ./packages/config/ -COPY packages/lib/package.json ./packages/lib/ -COPY packages/local/package.json ./packages/local/ -COPY packages/whitelabel/package.json ./packages/whitelabel/ -COPY packages/deployment/package.json ./packages/deployment/ -COPY packages/og/package.json ./packages/og/ -COPY packages/api-spec/package.json ./packages/api-spec/ - -# Install dependencies -RUN pnpm install --frozen-lockfile - -# Builder stage -FROM base AS builder -WORKDIR /app - -# Copy dependencies -COPY --from=deps /app/node_modules ./node_modules -COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules -COPY --from=deps /app/apps/worker/node_modules ./apps/worker/node_modules -COPY --from=deps /app/packages/ui/node_modules ./packages/ui/node_modules -COPY --from=deps /app/packages/config/node_modules ./packages/config/node_modules -COPY --from=deps /app/packages/lib/node_modules ./packages/lib/node_modules -COPY --from=deps /app/packages/local/node_modules ./packages/local/node_modules -COPY --from=deps /app/packages/whitelabel/node_modules ./packages/whitelabel/node_modules -COPY --from=deps /app/packages/deployment/node_modules ./packages/deployment/node_modules -COPY --from=deps /app/packages/og/node_modules ./packages/og/node_modules - -# Copy source code -COPY . . - -# Build arguments for VITE_ env vars (baked into client bundle) -ARG DEPLOYMENT_MODE=local -ARG VITE_DEPLOYMENT_MODE=${DEPLOYMENT_MODE} -ARG VITE_APP_NAME -ARG VITE_APP_ICON -ARG VITE_APP_URL -ARG VITE_APP_PARENT_NAME -ARG VITE_APP_PARENT_URL -ARG VITE_OPTIMIZATION_URL_TEMPLATE -ARG VITE_ONBOARDING_REDIRECT_URL_TEMPLATE -ARG VITE_AUTH0_DOMAIN -ARG VITE_AUTH0_CLIENT_ID -ARG VITE_APP_TIMEZONE -ARG VITE_APP_LOCALE -ENV VITE_DEPLOYMENT_MODE=${VITE_DEPLOYMENT_MODE} -ENV VITE_APP_NAME=${VITE_APP_NAME} -ENV VITE_APP_ICON=${VITE_APP_ICON} -ENV VITE_APP_URL=${VITE_APP_URL} -ENV VITE_APP_PARENT_NAME=${VITE_APP_PARENT_NAME} -ENV VITE_APP_PARENT_URL=${VITE_APP_PARENT_URL} -ENV VITE_OPTIMIZATION_URL_TEMPLATE=${VITE_OPTIMIZATION_URL_TEMPLATE} -ENV VITE_ONBOARDING_REDIRECT_URL_TEMPLATE=${VITE_ONBOARDING_REDIRECT_URL_TEMPLATE} -ENV VITE_AUTH0_DOMAIN=${VITE_AUTH0_DOMAIN} -ENV VITE_AUTH0_CLIENT_ID=${VITE_AUTH0_CLIENT_ID} -ENV VITE_APP_TIMEZONE=${VITE_APP_TIMEZONE} -ENV VITE_APP_LOCALE=${VITE_APP_LOCALE} - -# Build the web application (increase heap for large bundles) -RUN pnpm --filter @workspace/web build - -# Runner stage for web app (Nitro) -FROM base AS web -WORKDIR /app - -ENV NODE_ENV=production - -# Create non-root user -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 getcito - -# Copy entrypoint script -COPY docker/entrypoint.sh /entrypoint.sh -RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh - -# Copy Nitro output - this is the entire server bundle -COPY --from=builder --chown=getcito:nodejs /app/apps/web/.output ./.output - -USER getcito - -EXPOSE 3000 -ENV PORT=3000 -ENV HOST="0.0.0.0" - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["node", ".output/server/index.mjs"] - -# Migration stage — runs drizzle-kit migrate then exits -FROM base AS migrate -WORKDIR /app - -COPY --from=builder /app ./ -WORKDIR /app/packages/lib - -CMD ["npx", "drizzle-kit", "migrate"] - -# Worker stage -FROM base AS worker -WORKDIR /app - -ENV NODE_ENV=production - -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 worker - -COPY docker/entrypoint.sh /entrypoint.sh -RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh - -COPY --from=builder --chown=worker:nodejs /app ./ - -USER worker - -ENTRYPOINT ["/entrypoint.sh"] -WORKDIR /app/apps/worker -CMD ["npx", "tsx", "src/index.ts"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100644 index b41247b..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Database migrations are handled by the db-migrate init container. -# Execute the main command -exec "$@"