Create Dockerfile
Browse files- Dockerfile +57 -0
Dockerfile
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Node.js runtime as a base image
|
| 2 |
+
FROM node:18-bullseye
|
| 3 |
+
|
| 4 |
+
# Set working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies required for Playwright
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
wget \
|
| 10 |
+
curl \
|
| 11 |
+
unzip \
|
| 12 |
+
fonts-liberation \
|
| 13 |
+
libasound2 \
|
| 14 |
+
libatk-bridge2.0-0 \
|
| 15 |
+
libatk1.0-0 \
|
| 16 |
+
libcups2 \
|
| 17 |
+
libdbus-1-3 \
|
| 18 |
+
libgbm-dev \
|
| 19 |
+
libnspr4 \
|
| 20 |
+
libnss3 \
|
| 21 |
+
libxcomposite1 \
|
| 22 |
+
libxdamage1 \
|
| 23 |
+
libxfixes3 \
|
| 24 |
+
libxrandr2 \
|
| 25 |
+
xdg-utils \
|
| 26 |
+
libu2f-udev \
|
| 27 |
+
libvulkan1 \
|
| 28 |
+
xvfb \
|
| 29 |
+
--no-install-recommends && \
|
| 30 |
+
rm -rf /var/lib/apt/lists/*
|
| 31 |
+
|
| 32 |
+
# Set environment variable for Playwright browsers path
|
| 33 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 34 |
+
|
| 35 |
+
# Install project dependencies
|
| 36 |
+
RUN npm install cheerio axios playwright-core express dotenv
|
| 37 |
+
|
| 38 |
+
# Install Playwright browsers
|
| 39 |
+
RUN npx playwright install --with-deps chromium
|
| 40 |
+
|
| 41 |
+
# Clone the repository into a temporary directory
|
| 42 |
+
RUN git clone https://github.com/reaperofssa/sighy /tmp/repo
|
| 43 |
+
|
| 44 |
+
# Move repository files into /app (excluding .git directory)
|
| 45 |
+
RUN cp -r /tmp/repo/. /app/ && rm -rf /tmp/repo
|
| 46 |
+
|
| 47 |
+
# Copy the local application source code
|
| 48 |
+
COPY . .
|
| 49 |
+
|
| 50 |
+
# Ensure .env file permissions are secure
|
| 51 |
+
RUN chmod 600 .env || true
|
| 52 |
+
|
| 53 |
+
# Expose the port
|
| 54 |
+
EXPOSE 7860
|
| 55 |
+
|
| 56 |
+
# Start the application
|
| 57 |
+
CMD ["node", "server.js"]
|