working1 commited on
Commit
6f7e398
·
verified ·
1 Parent(s): 38836a0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +52 -0
Dockerfile ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Clone the repository
17
+ RUN git clone https://github.com/hakimi709/theboss /home/suhail
18
+
19
+ # Set the working directory
20
+ WORKDIR /home/suhail
21
+
22
+ # Grant full permissions to the directory (this step should help if there are permission issues)
23
+ RUN chmod -R 777 /home/suhail
24
+
25
+ # Change ownership of the directory to the 'node' user
26
+ RUN chown -R node:node /home/suhail
27
+
28
+ USER node
29
+
30
+ # Copy the server.js file into the working directory
31
+ COPY server.js .
32
+
33
+ COPY config.env /home/suhail
34
+
35
+ USER root
36
+ RUN chmod 777 /home/suhail/config.env
37
+ USER node
38
+
39
+ # Install dependencies (try npm first, fall back to yarn)
40
+ RUN yarn install
41
+
42
+ # Create the start.sh script directly
43
+ RUN echo '#!/bin/sh\nnode server.js &\nnpm start' > start.sh
44
+
45
+ # Make the start.sh script executable
46
+ RUN chmod +x start.sh
47
+
48
+ # Expose the port
49
+ EXPOSE 7860
50
+
51
+ # Run the start.sh script
52
+ CMD ./start.sh