2f32bfbab6
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 1m38s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
51 lines
1.2 KiB
Docker
51 lines
1.2 KiB
Docker
FROM node:20-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Chrome and dependencies for Puppeteer
|
|
RUN apt-get update && apt-get install -y \
|
|
chromium \
|
|
fonts-liberation \
|
|
libappindicator3-1 \
|
|
libasound2 \
|
|
libatk-bridge2.0-0 \
|
|
libatk1.0-0 \
|
|
libcups2 \
|
|
libdbus-1-3 \
|
|
libgdk-pixbuf2.0-0 \
|
|
libnspr4 \
|
|
libnss3 \
|
|
libx11-xcb1 \
|
|
libxcomposite1 \
|
|
libxdamage1 \
|
|
libxrandr2 \
|
|
xdg-utils \
|
|
--no-install-recommends && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set Puppeteer to use installed Chrome
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
|
|
# Copy package files
|
|
COPY apps/parapharmacy-api/package*.json ./
|
|
|
|
# Install dependencies (production only)
|
|
RUN npm install --omit=dev
|
|
|
|
# Copy source code
|
|
COPY apps/parapharmacy-api/src/ ./src/
|
|
|
|
# Copy scripts
|
|
COPY apps/parapharmacy-api/scripts/ ./scripts/
|
|
|
|
# Expose port
|
|
EXPOSE 3002
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD node -e "require('http').get('http://localhost:3002/api/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) })"
|
|
|
|
# Start server
|
|
CMD ["node", "--env-file-if-exists=.env", "src/server.js"]
|