# Image Generator for Power of Dark CMS

## Requirements

- node 20.12.2
- playwright 1.44.0

## Dockerfile

```dockerfile
# Get the base image of Node version 16
ARG NODE_VERSION=latest
ARG PLAYWRIGHT_VERSION=latest
FROM node:${NODE_VERSION}-slim

# Get the latest version of Playwright
FROM mcr.microsoft.com/playwright:${PLAYWRIGHT_VERSION}
 
# Set the environment path to node_modules/.bin
ENV PATH /app/node_modules/.bin:$PATH

# Get the needed libraries to run Playwright
RUN apt-get update && apt-get -y install libnss3 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libgbm-dev libasound-dev libatspi2.0-0 libxshmfence-dev

# Install the dependencies in Node environment
# RUN npm install
```

## Build

```bash
docker build -t node-20-playwright .
```

## Usage

```bash
# Run docker and attach to the process
docker run -it --rm --privileged \
    -v /volume1/homes/protocolnebula/development-environment/www/conquer-online/tools/image-generator/:/app/ \
    -w /app \
    --pid=host noide_custom:18 \
    bash

# Install and run
npm i
npm start
```