ken4 commited on
Commit
901a069
·
verified ·
1 Parent(s): 34a0314

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -21
Dockerfile CHANGED
@@ -2,47 +2,36 @@ FROM mcr.microsoft.com/playwright:focal
2
 
3
  # Skip Playwright browser downloads
4
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
5
-
6
- # Set timezone
7
  ENV TZ=Asia/Jakarta
 
8
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
9
 
10
  WORKDIR /app
11
 
 
12
  COPY brat-ip.tar.gz .
13
-
14
  RUN tar -xzf brat-ip.tar.gz && rm brat-ip.tar.gz
15
 
16
- WORKDIR /app
17
-
18
  # Install dependencies
19
  RUN npm install
20
-
21
- # Install Playwright dependencies and browsers
22
  RUN npx playwright install --with-deps
23
 
24
- # Install additional dependencies for fonts
 
 
 
 
25
  RUN apt-get update && apt-get install -y \
26
  wget \
27
  fontconfig \
28
  fonts-noto-color-emoji \
29
- fontconfig \
30
  --no-install-recommends && \
31
  rm -rf /var/lib/apt/lists/*
32
 
33
- # Download and install AppleColorEmoji.ttf
34
  RUN mkdir -p /usr/share/fonts/AppleColorEmoji && \
35
  wget -O /usr/share/fonts/AppleColorEmoji/AppleColorEmoji.ttf \
36
  https://github.com/samuelngs/apple-emoji-linux/releases/latest/download/AppleColorEmoji.ttf && \
37
- fc-cache -f -v
38
-
39
- RUN fc-list | grep -i "AppleColorEmoji"
40
-
41
- # Set environment variable for the app port
42
- ENV PORT=7860
43
-
44
- # Expose the port
45
- EXPOSE 7860
46
 
47
- # Start the application
48
- CMD ["node", "app.js"]
 
2
 
3
  # Skip Playwright browser downloads
4
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
 
 
5
  ENV TZ=Asia/Jakarta
6
+
7
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
8
 
9
  WORKDIR /app
10
 
11
+ # Copy & extract project
12
  COPY brat-ip.tar.gz .
 
13
  RUN tar -xzf brat-ip.tar.gz && rm brat-ip.tar.gz
14
 
 
 
15
  # Install dependencies
16
  RUN npm install
 
 
17
  RUN npx playwright install --with-deps
18
 
19
+ # Fix permission
20
+ RUN chmod -R 755 /app
21
+ RUN chown -R node:node /app
22
+
23
+ # Fonts
24
  RUN apt-get update && apt-get install -y \
25
  wget \
26
  fontconfig \
27
  fonts-noto-color-emoji \
 
28
  --no-install-recommends && \
29
  rm -rf /var/lib/apt/lists/*
30
 
 
31
  RUN mkdir -p /usr/share/fonts/AppleColorEmoji && \
32
  wget -O /usr/share/fonts/AppleColorEmoji/AppleColorEmoji.ttf \
33
  https://github.com/samuelngs/apple-emoji-linux/releases/latest/download/AppleColorEmoji.ttf && \
34
+ fc-cache
 
 
 
 
 
 
 
 
35
 
36
+ USER node
37
+ CMD ["node", "app.js"]