working2 commited on
Commit
e8dc7a5
·
verified ·
1 Parent(s): 00c80d3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Node.js LTS (Buster) as the base image
2
+ FROM node:latest
3
+
4
+ # Install FFmpeg, ImageMagick, and other essential tools
5
+ RUN apt-get update && \
6
+ apt-get install -y \
7
+ ffmpeg \
8
+ imagemagick \
9
+ ghostscript \
10
+ libreoffice \
11
+ libwebp-dev \
12
+ tesseract-ocr \
13
+ sox \
14
+ && apt-get clean \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Clone the repository
18
+ RUN git clone https://github.com/hakimi709/theboss /home/suhail
19
+
20
+ # Set the working directory
21
+ WORKDIR /home/suhail
22
+
23
+ # Grant full permissions to the directory (this step should help if there are permission issues)
24
+ RUN chmod -R 777 /home/suhail
25
+
26
+ # Change ownership of the directory to the 'node' user
27
+ RUN chown -R node:node /home/suhail
28
+
29
+ # Copy the server.js file into the working directory
30
+ COPY server.js .
31
+
32
+ COPY config.env /home/suhail
33
+
34
+ RUN chmod 777 /home/suhail/config.env
35
+
36
+ # Install dependencies (try npm first, fall back to yarn)
37
+ RUN yarn install
38
+
39
+ # Create the start.sh script directly
40
+ RUN echo '#!/bin/sh\nnode server.js &\nnpm start' > start.sh
41
+
42
+ # Make the start.sh script executable
43
+ RUN chmod +x start.sh
44
+
45
+ # Expose the port
46
+ EXPOSE 3000
47
+
48
+ # Run the start.sh script
49
+ CMD ./start.sh