.
This commit is contained in:
parent
bb59535f9a
commit
6942457f98
@ -37,7 +37,7 @@ FROM node:lts-iron AS prod
|
|||||||
ENV LANG es_ES.UTF-8
|
ENV LANG es_ES.UTF-8
|
||||||
|
|
||||||
# Descargar chromium
|
# Descargar chromium
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD false
|
#ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD false
|
||||||
|
|
||||||
# Install Google Chrome Stable and fonts
|
# Install Google Chrome Stable and fonts
|
||||||
# Note: this installs the necessary libs to make the browser work with Puppeteer.
|
# Note: this installs the necessary libs to make the browser work with Puppeteer.
|
||||||
@ -50,21 +50,19 @@ RUN apt-get update && apt-get install gnupg wget -y && \
|
|||||||
|
|
||||||
RUN apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libcairo2 libpango-1.0-0
|
RUN apt-get update && apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libcairo2 libpango-1.0-0
|
||||||
|
|
||||||
WORKDIR /api
|
# Install puppeteer so it's available in the container.
|
||||||
|
RUN yarn add puppeteer \
|
||||||
|
# Add user so we don't need --no-sandbox.
|
||||||
|
# same layer as npm install to keep re-chowned files from using up several hundred MBs more space
|
||||||
|
&& groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
|
||||||
|
&& mkdir -p /home/pptruser/Downloads \
|
||||||
|
&& chown -R pptruser:pptruser /home/pptruser \
|
||||||
|
&& chown -R pptruser:pptruser /node_modules \
|
||||||
|
&& chown -R pptruser:pptruser /package.json \
|
||||||
|
&& chown -R pptruser:pptruser /package-lock.json
|
||||||
|
|
||||||
# Copiar los archivos del build desde la fase anterior
|
# Run everything after as non-privileged user.
|
||||||
COPY --from=builder /api/dist .
|
USER pptruser
|
||||||
COPY --from=builder /api/server/package.json .
|
|
||||||
COPY --from=builder /api/server/tsconfig.production.json ./tsconfig.json
|
|
||||||
|
|
||||||
# Instalar sólo las dependencias de producción en el servidor
|
CMD ["google-chrome-stable"]
|
||||||
RUN yarn install --production
|
|
||||||
|
|
||||||
# Exponer el puerto que la API usa
|
|
||||||
EXPOSE 3001
|
|
||||||
|
|
||||||
#CMD pwd && ls -la
|
|
||||||
#CMD cat package.json
|
|
||||||
|
|
||||||
# Comando para correr la aplicación
|
|
||||||
CMD node -r ts-node/register/transpile-only -r tsconfig-paths/register ./server/src/index.js
|
|
||||||
Loading…
Reference in New Issue
Block a user