Files
FarmaFinder/apps/parapharmacy-api/Dockerfile
T
Antoni Nuñez Romeu a59fbda878
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 1m31s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Fixes on docker compose & Dockerfile for Parapharmacy API
2026-07-17 10:22:27 +02:00

48 lines
1.1 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/
# 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"]