mirror of
https://github.com/sheptikhinv/timers.git
synced 2026-02-06 23:41:35 +05:00
Introduce a multi-stage Dockerfile to build and serve a Node.js application using Nginx. Define a custom Nginx configuration for optimized static file handling and enable gzip compression.
11 lines
242 B
Docker
11 lines
242 B
Docker
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM nginx:stable
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY .docker/app/nginx/nginx.conf /etc/nginx/nginx.conf
|
|
EXPOSE 80
|