35 lines
760 B
Text
Executable file
35 lines
760 B
Text
Executable file
# NestJS API Server for E2E Testing
|
|
FROM node:22-alpine
|
|
|
|
# Build arg for registry auth
|
|
ARG NPM_TOKEN
|
|
|
|
WORKDIR /app
|
|
|
|
# Install wget for healthcheck
|
|
RUN apk add --no-cache wget
|
|
|
|
# Install @nestjs/cli globally
|
|
RUN npm install -g @nestjs/cli
|
|
|
|
# Configure npm registry for @lilith packages
|
|
RUN echo "@lilith:registry=http://forge.nasty.sh/api/packages/lilith/npm/" > .npmrc && \
|
|
echo "//forge.nasty.sh/api/packages/lilith/npm/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
|
|
# Copy all backend-api files first
|
|
COPY backend-api/ ./
|
|
|
|
# Install dependencies with npm
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
# Build using global nest
|
|
RUN nest build
|
|
|
|
# Remove .npmrc with token for security
|
|
RUN rm -f .npmrc
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Run the server
|
|
CMD ["node", "dist/main.js"]
|