Files
parcer/server/Dockerfile

52 lines
1.2 KiB
Docker
Raw Normal View History

2025-01-12 20:14:51 +05:30
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/playwright:v1.46.0-noble
2024-11-01 16:04:22 +05:30
2024-11-01 16:28:05 +05:30
# Set working directory
2024-11-01 16:04:22 +05:30
WORKDIR /app
2024-11-01 16:28:05 +05:30
# Install node dependencies
2024-11-01 16:04:22 +05:30
COPY package*.json ./
COPY maxun-core ./maxun-core
COPY src ./src
2024-12-23 01:15:00 +05:30
COPY public ./public
2024-11-01 16:04:22 +05:30
COPY server ./server
COPY tsconfig.json ./
COPY server/tsconfig.json ./server/
2024-11-03 15:32:33 +05:30
# COPY server/start.sh ./
2024-11-01 16:04:22 +05:30
# Install dependencies
2024-12-23 00:25:26 +05:30
RUN npm install --legacy-peer-deps
2024-11-01 16:04:22 +05:30
2024-11-01 16:28:05 +05:30
# Install Playwright browsers and dependencies
2024-11-02 00:22:57 +05:30
RUN npx playwright install --with-deps chromium
2024-11-03 01:09:09 +05:30
# Create the Chromium data directory with necessary permissions
RUN mkdir -p /tmp/chromium-data-dir && \
chmod -R 777 /tmp/chromium-data-dir
# Install dependencies
RUN apt-get update && apt-get install -y \
libgbm1 \
2024-11-03 01:09:09 +05:30
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libdrm2 \
libxkbcommon0 \
libglib2.0-0 \
libdbus-1-3 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxi6 \
libxtst6 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix
2024-11-01 16:04:22 +05:30
# Expose the backend port
2024-12-11 14:05:14 +05:30
EXPOSE ${BACKEND_PORT:-8080}
2024-11-01 16:04:22 +05:30
2024-11-02 00:22:57 +05:30
# Start the backend using the start script
CMD ["npm", "run", "server"]