Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +22 -42
Dockerfile
CHANGED
|
@@ -1,50 +1,21 @@
|
|
| 1 |
-
# Dockerfile
|
| 2 |
FROM node:16
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
RUN
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
libcups2 \
|
| 12 |
-
libdbus-1-3 \
|
| 13 |
-
libexpat1 \
|
| 14 |
-
libfontconfig1 \
|
| 15 |
-
libgcc1 \
|
| 16 |
-
libgconf-2-4 \
|
| 17 |
-
libgdk-pixbuf2.0-0 \
|
| 18 |
-
libglib2.0-0 \
|
| 19 |
-
libgtk-3-0 \
|
| 20 |
-
libnspr4 \
|
| 21 |
-
libpango-1.0-0 \
|
| 22 |
-
libpangocairo-1.0-0 \
|
| 23 |
-
libstdc++6 \
|
| 24 |
-
libx11-6 \
|
| 25 |
-
libx11-xcb1 \
|
| 26 |
-
libxcb1 \
|
| 27 |
-
libxcomposite1 \
|
| 28 |
-
libxcursor1 \
|
| 29 |
-
libxdamage1 \
|
| 30 |
-
libxext6 \
|
| 31 |
-
libxfixes3 \
|
| 32 |
-
libxi6 \
|
| 33 |
-
libxrandr2 \
|
| 34 |
-
libxrender1 \
|
| 35 |
-
libxss1 \
|
| 36 |
-
libxtst6 \
|
| 37 |
-
ca-certificates \
|
| 38 |
-
fonts-liberation \
|
| 39 |
-
libappindicator1 \
|
| 40 |
-
libnss3 \
|
| 41 |
-
lsb-release \
|
| 42 |
-
xdg-utils \
|
| 43 |
-
wget
|
| 44 |
|
| 45 |
# Create app directory
|
| 46 |
WORKDIR /usr/src/app
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Install app dependencies
|
| 49 |
COPY package*.json ./
|
| 50 |
RUN npm install
|
|
@@ -52,8 +23,17 @@ RUN npm install
|
|
| 52 |
# Bundle app source
|
| 53 |
COPY . .
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# Expose port
|
| 56 |
EXPOSE 3000
|
| 57 |
|
| 58 |
# Start the app
|
| 59 |
-
CMD [
|
|
|
|
|
|
|
| 1 |
FROM node:16
|
| 2 |
|
| 3 |
+
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
|
| 4 |
+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
| 5 |
+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
| 6 |
+
&& apt-get update \
|
| 7 |
+
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
|
| 8 |
+
--no-install-recommends \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Create app directory
|
| 12 |
WORKDIR /usr/src/app
|
| 13 |
|
| 14 |
+
# Add user so we don't need --no-sandbox.
|
| 15 |
+
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
|
| 16 |
+
&& mkdir -p /home/pptruser/Downloads \
|
| 17 |
+
&& chown -R pptruser:pptruser /home/pptruser
|
| 18 |
+
|
| 19 |
# Install app dependencies
|
| 20 |
COPY package*.json ./
|
| 21 |
RUN npm install
|
|
|
|
| 23 |
# Bundle app source
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Set correct permissions
|
| 27 |
+
RUN chown -R pptruser:pptruser /usr/src/app
|
| 28 |
+
|
| 29 |
+
# Create a directory for temporary files with correct permissions
|
| 30 |
+
RUN mkdir -p /tmp/marp-work && chown -R pptruser:pptruser /tmp/marp-work
|
| 31 |
+
|
| 32 |
+
# Run everything after as non-privileged user.
|
| 33 |
+
USER pptruser
|
| 34 |
+
|
| 35 |
# Expose port
|
| 36 |
EXPOSE 3000
|
| 37 |
|
| 38 |
# Start the app
|
| 39 |
+
CMD ["node", "server.js"]
|