vikarshana commited on
Commit
476a6b0
·
verified ·
1 Parent(s): ec9b76f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #Waddapak
2
+ FROM node:lts-buster
3
+
4
+ USER root
5
+ # Create app directory and set permissions 🙂😮‍💨
6
+ RUN mkdir -p /app && chown -R node:node /app
7
+
8
+ # Install necessary dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ git \
11
+ ffmpeg \
12
+ imagemagick \
13
+ webp \
14
+ && apt-get clean \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Set the working directory
18
+ WORKDIR /app
19
+
20
+ # Clone the private GitHub repository using the GitHub token from Docker BuildKit secrets
21
+ RUN --mount=type=secret,id=GITHUB_REPO,required=true \
22
+ --mount=type=secret,id=GITHUB_TOKEN,required=true \
23
+ git clone https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/$(cat /run/secrets/GITHUB_REPO).git .
24
+
25
+ # Switch to the node user
26
+
27
+ COPY --chown=node:node . .
28
+
29
+ RUN mkdir -p /app/lib/database && chown -R node:node /app/lib
30
+
31
+ # Set permissions for the /app directory to allow writing
32
+ RUN chmod -R 777 /app
33
+
34
+ # Install depends
35
+ RUN npm install node-cache
36
+
37
+ RUN npm install || yarn install
38
+ RUN yarn install --network-concurrency 1
39
+ EXPOSE 7860
40
+ ENV NODE_ENV=production
41
+ CMD ["npm", "start"]