queue_app / Dockerimage
multimodalart's picture
Create Dockerimage
ee426b0
raw
history blame
658 Bytes
# Use Node.js as base image
FROM node:14
# Install PM2 and NGINX
RUN npm install -g pm2 \
&& apt-get update \
&& apt-get install -y nginx
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy app.js and generate-config.js
COPY app.js .
COPY generate-config.js .
# Copy NGINX main config file
COPY nginx.conf /etc/nginx/
# Generate config files and start the applications at runtime
CMD ["sh", "-c", "node generate-config.js && cp default.conf /etc/nginx/conf.d/ && pm2 start ecosystem.config.js && nginx -g 'daemon off;'"]
# Expose ports
EXPOSE 7860