Skip to content

Commit

Permalink
[FIX] no clean up, no special user
Browse files Browse the repository at this point in the history
  • Loading branch information
swiknaba committed Nov 28, 2023
1 parent c5ecb0d commit 18a6864
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,23 @@ RUN apt-get update \
libxss1 \
google-chrome-stable \
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
# Clean up
&& apt-get purge --auto-remove -y wget gnupg \
&& rm -rf /var/lib/apt/lists/*

# Set environment variable to skip the chromium download.
# Set environment variable to skip the chromium download
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Add user for running the application
RUN groupadd -r pptruser \
&& useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser
ENV PUPPETEER_SKIP_DOWNLOAD true

WORKDIR /usr/src/app

# Copy package.json and yarn.lock first to leverage Docker cache
COPY --chown=pptruser:pptruser package.json yarn.lock ./
# Copy package.json and yarn.lock
COPY package.json yarn.lock ./

# Install dependencies
ARG NODE_ENV=production
RUN yarn install --frozen-lockfile --production

# Copy the application source code
COPY --chown=pptruser:pptruser . .

# Run the application as non-privileged user
USER pptruser
COPY . .

EXPOSE 5017

Expand Down

0 comments on commit 18a6864

Please sign in to comment.