PSA/ee/server/Dockerfile.dev
Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

80 lines
2.3 KiB
Docker

FROM node:alpine AS server
# Build arguments to control edition and provide build-only auth secret fallback
ARG INCLUDE_EE=true
ARG NEXTAUTH_SECRET_BUILD="dev-placeholder-nextauth-secret-32"
# Install required system dependencies (rarely changes)
RUN apk add --no-cache \
graphicsmagick \
imagemagick \
ghostscript \
postgresql-client \
redis \
curl \
bash
WORKDIR /app
# Copy only package files first for npm install
COPY package.json package-lock.json ./
COPY server/package.json ./server/
COPY ee/server/package.json ./ee/server/
COPY scripts/ ./scripts/
# Install dependencies (cached unless package files change)
COPY server/src/invoice-templates/assemblyscript ./server/src/invoice-templates/assemblyscript
RUN npm install && \
cd server/src/invoice-templates/assemblyscript && \
npm install && \
cd /app
COPY tsconfig.base.json ./
WORKDIR /app
COPY shared/ ./shared/
COPY services/ ./services/
# Copy EE features conditionally
COPY ee/ ./ee/
# Handle edition-specific setup
RUN if [ "$INCLUDE_EE" = "true" ]; then \
echo "Including EE features..."; \
NEXTAUTH_SECRET="$NEXTAUTH_SECRET_BUILD" AUTH_SECRET="$NEXTAUTH_SECRET_BUILD" ./scripts/build-enterprise.sh; \
else \
echo "Building CE edition - excluding EE features..."; \
rm -rf ./ee; \
fi
WORKDIR /app/server
# Copy server source code
COPY server/ ./
COPY packages/ /app/packages/
COPY scripts/ ./scripts/
# Build all upstream packages (shared + pre-built) via Nx (handles dependency ordering)
RUN cd /app && npx nx build-deps server
ENV USE_PREBUILT="true"
# Clean any existing build artifacts and build the Next.js application with conditional env var
RUN rm -rf .next && \
if [ "$INCLUDE_EE" = "true" ]; then \
NEXTAUTH_SECRET="$NEXTAUTH_SECRET_BUILD" AUTH_SECRET="$NEXTAUTH_SECRET_BUILD" npm run build:enterprise; \
else \
NEXTAUTH_SECRET="$NEXTAUTH_SECRET_BUILD" AUTH_SECRET="$NEXTAUTH_SECRET_BUILD" npm run build; \
fi
# Copy core package.json for version info
COPY packages/core/package.json /app/packages/core/package.json
# Copy and make entrypoint executable (rarely changes)
COPY server/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
EXPOSE 3000
ENV NODE_ENV=production
ENTRYPOINT ["/app/entrypoint.sh"]