File size: 1,168 Bytes
05e53e4
7025d43
fe244d6
ec1a981
 
 
fd5226a
ec1a981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
05e53e4
fb85807
fe244d6
c04d3ae
fb85807
c04d3ae
fe244d6
fb85807
54e4fd0
fe244d6
ec1a981
 
 
 
05e53e4
 
 
6fb51cb
ec1a981
 
 
05e53e4
 
6fb51cb
05e53e4
ec1a981
6fa9f7f
05e53e4
fad413e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Use Node.js 16 as the base image
FROM node:16

# Install Chromium and LibreOffice
RUN apt-get update && apt-get install -y \
    chromium \
    libreoffice \
    fonts-liberation \
    # Additional dependencies that might be needed
    libx11-xcb1 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxi6 \
    libxtst6 \
    libnss3 \
    libcups2 \
    libxss1 \
    libxrandr2 \
    libasound2 \
    libpangocairo-1.0-0 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libgtk-3-0 \
    --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
COPY package*.json ./
RUN npm install

# Bundle app source
COPY . .

# Create tmp directory and set permissions
RUN mkdir -p /tmp/marp-work && \
    chown -R node:node /tmp/marp-work

# Create a non-root user
RUN groupadd -r nodeuser && useradd -r -g nodeuser nodeuser \
    && chown -R nodeuser:nodeuser /usr/src/app

# Set environment variable for Chromium
ENV CHROME_PATH=/usr/bin/chromium

# Switch to non-root user
USER nodeuser

# Expose the port the app runs on
EXPOSE 7860

# Start the application
CMD ["node", "index.js"]