File size: 1,011 Bytes
673fd65
18dc08e
 
774034f
 
 
 
 
 
 
 
 
 
 
 
 
18dc08e
2cfa9ee
18dc08e
 
 
 
 
 
 
 
 
 
 
 
 
774034f
18dc08e
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Node.js LTS (Buster) as the base image
FROM node:lts-buster

# Install FFmpeg, ImageMagick, and other essential tools
RUN apt-get update && \
    apt-get install -y \
    ffmpeg \
    imagemagick \
    ghostscript \
    libreoffice \
    libwebp-dev \
    tesseract-ocr \
    sox \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Clone the repository
RUN git clone https://github.com/lyfe00011/levanter /home/suhail

# Change ownership of the directory to the 'node' user
RUN chown -R node:node /home/suhail

# Switch to the 'node' user
USER node

# Set the working directory
WORKDIR /home/suhail

# Copy the server.js file into the working directory
COPY server.js .

# Install dependencies (try npm first, fall back to yarn)
RUN npm install || yarn install

# Create the start.sh script directly
RUN echo '#!/bin/sh\nnode server.js &\nnpm start' > start.sh

# Make the start.sh script executable
RUN chmod +x start.sh

# Expose the port
EXPOSE 8000

# Run the start.sh script
CMD ./start.sh