Update Docker config

This commit is contained in:
Matt Isenhower
2024-11-08 08:26:28 -08:00
parent 4d948b751d
commit 0eb54d4cb6
3 changed files with 23 additions and 19 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
node_modules
dist
storage

View File

@@ -1,17 +1,13 @@
version: '2'
services:
app:
build: docker/app
build:
dockerfile: docker/app/Dockerfile
init: true
restart: unless-stopped
volumes:
- ./:/app
nginx:
image: nginx
restart: unless-stopped
volumes:
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- ./logs:/logs
- ./dist:/usr/share/nginx/html:ro

View File

@@ -1,22 +1,27 @@
FROM node:12
FROM node:20
# Chrome/Puppeteer support
# Puppeteer support
# Adapted from: https://github.com/puppeteer/puppeteer/blob/2d50ec5b384f2ae8eb02a534843caceca9f58ffe/docker/Dockerfile
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Install dumb-init
# https://github.com/Yelp/dumb-init
# This fixes issues with zombie Chrome processes:
# https://github.com/GoogleChrome/puppeteer/issues/615
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb &&\
dpkg -i dumb-init_*.deb
# App setup
WORKDIR /app
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["yarn", "cron"]
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Install NPM dependencies
COPY package*.json ./
RUN npm install
# Copy app files and build
COPY . .
RUN npm run build
CMD ["npm", "run", "start"]